How to allow access outside localhost

后端 未结 15 841
失恋的感觉
失恋的感觉 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:05

    • Use ng serve --host --port.

    • ng serve --host=192.111.1.11 --port=4545.

    • You can now see the below line at the end of compilation.

    Angular Live Development Server is listening on 192.111.1.11:4545, open your browser on http://192.111.1.11:4545/ **.

提交回复
热议问题