我习惯于一个开发环境,我在本地运行一个小型节点服务器,并将我的服务调用到远程REST API。 我现在在一切都是本地的设置。 有一个运行REST API的本地tomcat实例,Nginx被用来将来自我的angular应用程序的调用路由到tomcat服务器。 我遇到的问题是运行我的grunt服务器任务 – 它启动一个连接服务器运行在端口9000; 实时重新加载function不可用,因为Nginx正在监听端口80,所以要查看我必须到localhost / xyz的更改。 将Nginx.server.listen端口更改为端口9000也不起作用。
#user nobody; worker_processes 1; error_log logs/error.log; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; root /Users/me/dev/angular-project/app; //this looks at my angular app index index.html index.htm; server_name localhost; location / { try_files $uri /index.html?v=100515130; } location /services1 { proxy_pass http://localhost:8080/services1; //this is one of my services call addresses proxy_set_header Host localhost; } location /services2 { proxy_pass http://localhost:8080/services2; //this is another service call address proxy_set_header Host localhost; } } include servers/*;
}
我希望能够做的是非常标准的东西 – 观察我的.scss和es6文件并在变化时编译,然后在更改时重新加载浏览器。 这是我的gruntfile中的连接过程:
connect: { options: { port: 9001,// Change this to '0.0.0.0' to access the server from outside. //hostname: 'localhost' hostname: '0.0.0.0' },livereload: { options: { middleware: function (connect) { return [ modRewrite([ '^[^\.]*$ /index.html [L]' ]),lrsnippet,mountFolder(connect,'.tmp'),yeomanConfig.app) ]; } } },
我不熟悉Nginx和tomcat,但在节点构build工具中非常舒服; 咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜,
如何让Karma使用Chrome
使用barryvdh / laravel-cors的Laravel angularJS CORS
docker工人的angular度应用程序 – 生产和发展
跨域使用Nginx,sails和upstart的configuration问题
如何将我的angular度前端与我的节点/数字海洋上的Nginx快速后端分开?
我是否需要在我的Nginx设置中更改某些内容以使其发生,或者在我的咕噜设置中,或两者兼而有之?
从sql Server中检索数据并将其转换为json格式?
使用Nginx服务angular度应用
AngularJS路由没有散列“#” – 不能得到它的工作
如何设置Nginx背后的Phantomjs
Nginx,Node,Angular – 子文件夹API / URLconfiguration
我没有看到options.livereload
connect: { options: { port: 9001,// Change this to '0.0.0.0' to access the server from outside. //hostname: 'localhost' hostname: '0.0.0.0' livereload: 35729 },livereload: { options: { livereload: true middleware: function (connect) { return [ modRewrite([ '^[^\.]*$ /index.html [L]' ]),
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。