eylesa
eylesa

Reputation: 171

node.js url without port number

I'm creating node.js project now. I've a VPS which ubuntu 16.04 as op system and nginx as http server installed on it. As you know we use URL with port number like http://localhost.com:3000 to access our node.js projects. I wonder is there any way to access without port number like http://localhost.com like normal php and other projects?

Upvotes: 0

Views: 2422

Answers (2)

Lix
Lix

Reputation: 47956

The only reason we use those kinds of port numbers for local development is because ports under 1024 are "reserved" and require root permissions to be used. You can still use port 80 for local development if you set your node server to listen on this port.

If you do make these changes to your node server, in order to run it locally you will need to run it as root or using sudo.

Upvotes: 0

Related Questions