How to allow access outside localhost

后端 未结 15 887
失恋的感觉
失恋的感觉 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条回答
  •  猫巷女王i
    2020-12-07 07:59

    Open cmd and navigate to project location i.e. where you run npm install or ng serve for the project.

    and then run the command - ng serve --host 10.202.32.45 where 10.202.32.45 is your IP address.

    You will be able to access your page at 10.202.32.45:4200 where 4200 is your port number.

    Note: If you serve your app using this command then you won't be able to access localhost:4200

提交回复
热议问题