Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude port number in URL - Angular2

I want to exclude the port number for my angular2 application in the URI, so far its http://localhost:3000/ instead of just being http://localhost/. I am using angular2 with webpack2. How would I go about doing this on development in dev-server, would I use a proxy?

-G

like image 557
TGarrett Avatar asked Apr 25 '26 16:04

TGarrett


1 Answers

A url like http://localhost actually has a port number, it's the default http port of 80. So you could configure your Angular app to simply use port 80 instead of port 3000.

Most projects use ports other than 80 because most web developers have a system-wide webserver that's already running on port 80 (Apache, nginx, etc).

like image 128
user2926055 Avatar answered Apr 28 '26 07:04

user2926055



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!