简体   繁体   中英

How to change the port for the npm run watch?

I am trying to watch the development using npm run watch . But it moved to http://localhost:3000 instead of http://localhost:8080 . How to change this port 3000 to 8080? Because I am using the Tomcat server in 8080 port.

[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:

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:

ng serve --port 8000

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM