【问题标题】:How to change the port for the npm run watch?如何更改 npm run watch 的端口?
【发布时间】:2017-05-01 05:10:04
【问题描述】:

我正在尝试使用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
 -----------------------------------------------------------------------

【问题讨论】:

    标签: angularjs node.js npm localhost


    【解决方案1】:

    更新 bs-config.json 文件:

    例如:

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

    但如果是 angular2-cli,您需要提供这样的端口参数:

    ng serve --port 8000
    

    【讨论】:

      猜你喜欢
      • 2017-10-22
      • 2019-09-25
      • 1970-01-01
      • 2021-06-07
      • 2019-07-11
      • 2020-04-02
      • 2020-10-01
      • 2020-03-02
      • 2017-12-23
      相关资源
      最近更新 更多