如何将Angular localhost:4200 改为IP

  • 2020 年 1 月 16 日
  • 筆記

如何将Angular localhost:4200 改为IP

ust specify the IP in –host option like ng serve –host 192.16.1.1

Now you can visit http://192.16.1.1:4200 in your browser and it will work

下面是一个例子:

ng serve –host 192.168.1.102 –port 4201

Exit mobile version