簡體   English   中英

如何更改npm run watch的端口?

[英]How to change the port for the npm run watch?

我正在嘗試使用npm run watch開發。 但是它移到了http:// localhost:3000而不是http:// localhost:8080 如何將此端口3000更改為8080? 因為我在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
 -----------------------------------------------------------------------

更新bs-config.json文件:

例如:

 {
  "port": 8000,
  "files": ["./src/**/*.{html,htm,css,js}"],
  "server": { "baseDir": "./src" }
}

但是在angular2-cli的情況下,您需要提供如下的port參數:

ng serve --port 8000

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM