How to change angular port from 4200 to any other

后端 未结 29 1771
心在旅途
心在旅途 2020-12-04 05:59

I want to use 5000 instead of 4200.

I have tried to create a file on root name ember-cli and put JSON according to the code below:

{
   &q         


        
29条回答
  •  时光取名叫无心
    2020-12-04 06:29

    You can edit default port number that is configured in serve.js file.

    Path will be project_direcory/node_modules/angular-cli/commands/serve.js.

    Search for this line -> var defaultPort = process.env.PORT || 4200;
    Replace with this line -> var defaultPort = process.env.PORT || 5000;

提交回复
热议问题