Set default host and port for ng serve in config file

后端 未结 12 2244
庸人自扰
庸人自扰 2020-12-07 07:53

I want to know if i can set a host and a port in a config file so I don\'t have to type

ng serve --host foo.bar --port 80

instead of just

12条回答
  •  广开言路
    2020-12-07 08:40

    If your are on windows you can do it this way :

    1. In your project root directory, Create file run.bat
    2. Add your command with your choice of configurations in this file. For Example

    ng serve --host 192.168.1.2 --open

    1. Now you can click and open this file whenever you want to serve.

    This not standard way but comfortable to use (which I feel).

提交回复
热议问题