title: Express.js vhost subdomain set up
body: <p>Trying to set up connect's vhost middleware. Would love some help.</p>
  
  <p>I've got my normal express.js app, with node_modules, public, views and routes directories. I've added another directory next to those which holds another express.js app.</p>
  
  <p>I've added this line to my top level app (tedxgramercy):</p>
  
  <pre><code>app.use(express.vhost('chatter.tedxgramercy.com', require('./chatter/app.js').app));
  </code></pre>
  
  <p>And this line to my chatter app:</p>
  
  <pre><code>var app = exports.app = express();
  </code></pre>
  
  <p>The chatter app calls listen on port 8000, the main (top level) app calls listen on port 3000. I don't know if that's right.</p>
  
  <p>When I launch my app (node app) it runs fine and I can access both apps on localhost:3000 and localhost:8000 respectively, but when I deploy to my server, the subdomain <a href="http://chatter.tedxgramercy.com" rel="noreferrer">http://chatter.tedxgramercy.com</a> doesn't work.</p>
  
  <p>Any pointers? Do I have to change my DNS to point to the other port or something?</p>