deepthan / blog-angular

Angular 笔记
280 stars 58 forks source link

【Angular】 #154

Open deepthan opened 3 years ago

deepthan commented 3 years ago

1. 如何让别人可以访问自己本地启动的服务

使用ipconfig查看自己的ipV4地址,如192.168.16.11,之后在加上--host 192.168.16.11 ,关闭本地防火墙别人即可访问你的项目。

也可以直接使用--host 0.0.0.0启动。 访问地址
192.168.16.11:4200

启动方式
ng server --host 192.168.16.11

zmj0920 commented 2 years ago

ng serve --host 192.168.16.11