angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Angular2 Application over intranet

Open RamitAnandSharma opened this issue 10 years ago • 4 comments

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Windows 10

My application is accessible with http://localhost:4200/ But not with http://ip:4200/

How can i make my application accessible over intranet.

I verified the firewall setting also.

RamitAnandSharma avatar Oct 20 '16 05:10 RamitAnandSharma

ng serve is only intended for development. If you want to make you application accessible to others you need to build it with ng build --prod [--aot] first. You may then host the generated /dist folder using either Apache, nginx, or something simpler like http-server.

Kattjakt avatar Oct 20 '16 07:10 Kattjakt

If you want your dev env to be accessible over the internet (sharing with a co worker etc) you can do ng serve --host 0.0.0.0.

0.0.0.0 will bind to all hosts on your computer instead of just localhost.

If you're talking about prod on the other hand, see the answer above.

grizzm0 avatar Oct 20 '16 11:10 grizzm0

^ what @grizzm0 said 💃

filipesilva avatar Oct 23 '16 20:10 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.