If you're learning backend development, you've probably seen things like:
localhost:3000
localhost:5000
:80
:443
At first, the port number can seem like just another configuration value.
But why does a server need a port when it already has an IP address?
If one server is running a Node.js API, PostgreSQL, Redis, and NGINX at the same time, how does the operating system know which application should receive an incoming request?
That's the problem ports solve.
...