Introduction
Listening on a port lets your Express app accept requests from users or other programs. It opens a door for communication.
When you want your web app to be reachable on the internet or local network.
When testing your Express server locally to see how it responds.
When deploying your app so it can handle real user traffic.
When running multiple apps on different ports on the same machine.
When you want to specify a custom port instead of the default.