Port

You might say

The local app runs on port 3000 and the API on 4000. Help me confirm which one the browser reaches.

A port is a numbered network entry that distinguishes services on the same host.After npm run dev, a page commonly opens at http://localhost:3000, while an API on the same machine may listen on 4000. localhost means the current device only; ports keep multiple local services separate.
Know first
Port Number
Further reading