title: How to run two servers on Heroku?
body: <p>I have built a project in Angular 9 for the frontend and Node.js as the backend server.</p>
  <p>Now I am running <code>node appserver.js</code> for running the backend server. This listens to port 9090 as default. In another terminal, I am running <code>ng serve</code> to run my Angular app on port 4200 as usual. I have a service in the Angular app that sends and receives messages from server.</p>
  <p>I have used <code>WebSocket</code> class to connect to the port 9090. My app works fine in local. But now how could I deploy in Heroku. Heroku gives a random port number which will be specified as <code>process.env.PORT</code>. how could I get that port in my WebSocket service?</p>
  <p>My questions are:</p>
  <ol>
  <li>How to deploy two servers in Heroku?</li>
  <li>How port number in appserver.js is specified as port number in WebSocket service in Angular?</li>
  <li>Is there any use of the .env file and ProcFile to solve my problem?</li>
  <li>Is there any use of multi-buildpack which is in Heroku to solve my problem?</li>
  </ol>