title: Heroku-Server: Why there is no port in the endpoint URL?
body: <p>I have done a little Chat-App -> React JS Chat Client and Node-JS (socket.io / express) Web-Socket server.</p>
  
  <p>After I finished testing I deployed the NodeJS-Web-Socket server on heroku.</p>
  
  <p>The URL I should use in the <strong>Client</strong> is <code>const ENDPOINT = 'https://jorroch-consulting.herokuapp.com/';</code></p>
  
  <p>What makes me wondering is that I had to use a <strong>port</strong> in the endpoint URL, when my server still was started on localhost.
  The URL looked like this: <code>const ENDPOINT = 'localhost:5000';</code></p>
  
  <p>That was because my server was listening to port 5000:
  <code>server.listen(PORT, () =&gt; console.log('Server has started on port ${PORT}'));</code></p>
  
  <p>Now, that the server is deployed on heroku the client does not have the info about the port 5000 and it works nevertheless.</p>
  
  <p><strong>How does my React-Client know which is the proper port? Does heroku routes all requests to port 5000? But how do they know? Do they scan the code?</strong></p>
  
  <p>I am asking, because I want to create a second WebSocket-Express server in the same index.js (is that possible?) file and redeploy that to heroku but think, without the use of different ports, that could not work.</p>