How to allow access outside localhost

后端 未结 15 895
失恋的感觉
失恋的感觉 2020-12-07 07:25

How can I allow access outside the localhost at Angular2? I can navigate at localhost:3030/panel easily but I can not navigate when I write my IP such as

15条回答
  •  余生分开走
    2020-12-07 08:01

    Mac users:

    1. Go to System Preferences -> Network -> Wi-Fi
    2. Copy the IP address below Status (Usually 192.168.1.x)
    3. Paste it in your ng serve like: ng serve --host 192.168.1.x

    Then you must be able to see your page on other devices through 192.168.1.x:4200.

提交回复
热议问题