How to change angular port from 4200 to any other

后端 未结 29 1784
心在旅途
心在旅途 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:06

    For angular 10+:

    1. Navigate to angular.json file.
    2. Search for the "serve" field.
    3. Under "serve" it will the "options" field.
    4. Add this line to "options": "port": 4202(any port that you want).

    Example:

            "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "dashboard:build",
            **"port": 4202**
          },
          "configurations": {
            "production": {
              "browserTarget": "dashboard:build:production"
            }
          }
        },
    

提交回复
热议问题