title: Using VHOST for subdomains on Express
body: <p>I have 2 separated site (static web and application). I've tried to use <code>Express vhost</code> middleware but I couldn't manage.</p>
  
  <p>For the below codes I configured my <code>hosts</code> file as;</p>
  
  <pre><code>127.0.0.1  localhost
  127.0.0.1  process.localhost
  </code></pre>
  
  <p>my <code>server.js</code> codes</p>
  
  <pre><code>var connect = require('connect')
  var express = require('express')
  var vhost = require('vhost')
  var app = require('./app')
  var static = require('./static')
  
  var server = connect()
  
  server
  .use(vhost('localhost', static.service))
  .use(vhost('process.localhost', app.service))
  .listen(1337, function(){
    console.log('Server is listening')
  })
  </code></pre>
  
  <p>Then if I write my address bar <em>localhost:1337</em> static page comes this is good. However, if I write <em>process.localhost:1337</em> nothing comes.</p>
  
  <p>What should I do?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>If I add the below middleware to my codes when I write the address bar <code>localhost:1337</code> console write <code>localhost:1337</code> but is I write <code>process.localhost:1337</code> console write nothing.   </p>