Expose routes on different domains
<p>I am struggling with something that doesn't look that hard : let's say I have 2 urls to access my server :</p>

<pre><code>http://localhost:80/ 
</code></pre>

<p>and an external url</p>

<pre><code>http://domain.com/internal/
</code></pre>

<p>Is there a way to do add a basepath <code>internal</code> if the forwarded host is equal to the external url host?</p>

<p>Something like :</p>

<pre><code>app.use(function(req, res, next) {
  if (req.headers['x-forwarded-host'] === 'domain.com') {
    app.use('/internal', routes);
  } else {
    next();
  }
})
</code></pre>