I am able to connect to my Nodejs API server through aws by entering url such as ip + :3000. Now I do not want to show port no 3000 after url. is there any way to hide this or this will be there compulsory?
Asked
Active
Viewed 1,972 times
2
-
See http://stackoverflow.com/questions/16573668/best-practices-when-running-node-js-with-port-80-ubuntu-linode for a few different ways of getting Node to work with port 80 (HTTP default port). – Graham Apr 06 '17 at 08:21
1 Answers
3
You can't do this on the client side. You need to do one of:
- Have your nodejs server running on port 80/443
- Run a webserver (apache,nginx) on your nodejs server as a reverse proxy
- Use a load balancer.

Daniel Scott
- 7,418
- 5
- 39
- 58
-
-
-
yes,right now I am running express on port no 3000.Should I change the port number? – Mrugesh Apr 06 '17 at 08:36
-
Up to you - it might be better to run your webserver on the 'privileged' port (<1024) and then proxy to your node server on 3000, or just run the node server on the desired port. Up to you really, depending on your use case. If this is an important service which might need to provide other features in the future then I'd probably go for the reverse proxy, if you're just testing things out or it's just a simple single service then I'd run it directly. – Daniel Scott Apr 06 '17 at 08:39