It’s more obscure for users if they have to open http://localhost:some_port/. You also have to decide on a hopefully free port.
As an aside, if the application isn’t careful, that approach can potentially open up a security hole, because external javascript on a web page in your browser can perform requests to localhost.