Reputation: 75
What does a port change about my server? I've seen a lot of people use port 3000 in their code. Any NodeJS server I make has at least two things: HTTP and Express.
Upvotes: 0
Views: 538
Reputation: 385
The port is simply a communication endpoint for your application. Changing your port will have no affect on how your application runs. Note that most applications have ports that they use (for example Redis typically uses port 6379), but can be configured to use any port. I generally use port 8000, but you can pick any port you want as long as it's not taken by another application on your machine!
Upvotes: 1
Reputation: 558
It changes nothing, you can basically write any port and if the port is free, everything will be fine, you can read more about ports here with very simple explanation
Upvotes: 1
Reputation: 313
It's the port that your server will listen on. So, if you are listening on port 2000, you would go to http://YourDomain.com:2000
. Make sure the port you are listening on is open of course! Port 80 is the standard port for http, and port 443 for https.
I commonly see node sites using 8080 (which is an alternative to 80)
Upvotes: 2