title: Node.js: Run multiple apps on the same server
body: <p>I want to run multiple Node.js (Express) applications on the same server. I am aware of two different methods: </p>
  
  <ol>
  <li><p>Using a reverse proxy to redirect requests to applications listening on different ports. For example </p>
  
  <p><code>https://website.com/app1 --&gt; https://localhost:1001
   https://website.com/app2 --&gt; https://localhost:1002</code></p></li>
  <li><p>Using express middleware to run the applications on the same port (<a href="https://stackoverflow.com/questions/11225983/running-multiple-node-express-apps-on-same-port">Running multiple Node (Express) apps on same port</a>):</p></li>
  </ol>
  
  <pre class="lang-js prettyprint-override"><code>app
    .use('/app1', require('./app1/index').app)
    .use('/app2', require('./app2/index').app)
    .listen(8080);
  </code></pre>
  
  
  
  <p>What are the advantages and disadvantages of these two methods?</p>