【发布时间】:2014-09-04 06:25:49
【问题描述】:
我想在自定义域的生产服务器上测试我的 Angular 应用程序。
我尝试过这样做:
- 我停用了 Apache 服务器
- 我在 /etc/hosts 127.0.0.1:9000 mydomain.loc 中添加了一行
-
我将配置更新为 GruntFile.js
// 实际的 grunt 服务器设置
connect: { options: { port: 9000, // Change this to '0.0.0.0' to access the server from outside. hostname: 'localhost', livereload: 35729 }, livereload: { options: { open: 'http://mydomain.loc:9000', base: [ '.tmp', '<%= yeoman.app %>' ] } }, test: { options: { port: 9001, base: [ '.tmp', 'test', '<%= yeoman.app %>' ] } },
在此之后,我使用 grunt serve 命令 运行服务器。
Grunt 已初始化,浏览器窗口在正确的地址 mydomain.loc:9000 处打开
但是在浏览器中找不到服务器。
问题是:
我做错了什么,我该如何解决?
我想,这不需要 Apache?
感谢您的任何建议。
【问题讨论】:
-
真的没人知道吗?
标签: javascript angularjs gruntjs virtualhost hosts