[英]How to change the port for the npm run watch?
I am trying to watch the development using npm run watch
. 我正在尝试使用
npm run watch
开发。 But it moved to http://localhost:3000 instead of http://localhost:8080 . 但是它移到了http:// localhost:3000而不是http:// localhost:8080 。 How to change this port 3000 to 8080?
如何将此端口3000更改为8080? Because I am using the Tomcat server in 8080 port.
因为我在8080端口中使用Tomcat服务器。
[BS] Proxying: http://localhost:8080
[BS] Access URLs:
-----------------------------------------------------------------------
Local: http://localhost:3000/server1/demo3/index.html
External: http://192.168.126.1:3000/server1/demo3/index.html
-----------------------------------------------------------------------
UI: http://localhost:3001
UI External: http://192.168.126.1:3001
-----------------------------------------------------------------------
update bs-config.json file: 更新bs-config.json文件:
Eg: 例如:
{
"port": 8000,
"files": ["./src/**/*.{html,htm,css,js}"],
"server": { "baseDir": "./src" }
}
But in case of of angular2-cli, you need to provide at port argument like this: 但是在angular2-cli的情况下,您需要提供如下的port参数:
ng serve --port 8000
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.