angular-cli修改端口号【angular2】

小园的景色,比想象的绿,绿色世界里溢出的那股泥土味,流过背着阳光的小土丘,一大片嫩绿涌入眼底,一粒粒草叶上滑落的雨滴,一朵朵淡黄的小花含着笑将露滴入另一处世界。

找到node_modules/angular-cli/lib/config/schema.json

default值就是默认的端口

"serve": {
 "description": "Properties to be passed to the serve command",
 "type": "object",
 "properties": {
  "port": {
  "description": "The port the application will be served on",
  "type": "number",
  "default": 4200
  },
  "host": {
  "description": "The host the application will be served on",
  "type": "string",
  "default": "localhost"
  }
 }
 }
}

也可以通过命令行方式修改,如:

ng serve --port 4201

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持!

您可能有感兴趣的文章
JS获取鼠标点击时的位置

vue、nginx部署后刷新报404错误的解决方法

electron-builder配置项

VUE聊天页面自动滚动到底部

VUE CTRL+ENTER换行,ENTER发送消息