title: express-subdomain not redirecting subdomain.localhost get request
body: <p>I am using an express.js package called <a href="https://github.com/bmullan91/express-subdomain" rel="nofollow">express-subdomain</a> to facilitate requests to defined subdomains I set up.</p>
  
  <p>As far as I understand, the subdomain constructor function expects an express router object which I pass to it from an exported router module.</p>
  
  <p>What I have tried is as follows:</p>
  
  <p>MAIN APP.JS SERVER FILE</p>
  
  <pre><code>var common = {
      express: require('express'),
      subdomain: require('express-subdomain')
  
  };
  
  common.app = common.express();
  
  module.exports = common;
  
  common.app.listen(3000, function () {
    console.log(('app listening on http://localhost:3000'));
  });
  
  var router = require('./router/index');
  
  
  // Error Handling
  common.app.use(function(err, req, res, next) {
      res.status(err.status || 500);
  });
  </code></pre>
  
  <p>router/index</p>
  
  <pre><code> module.exports = function (){
          var common = require('../app');
          var router = common.express.Router();
  
          common.app.get('/', function(req, res) {
          res.send('Homepage');
          });
  
  
          common.app.use('/signup', require('./routes/signup'));
          common.app.use(common.subdomain('login', require('./routes/login')));
      }();
  </code></pre>
  
  <p>routes/login</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  
  
  router.get('/', function (req, res) {
      res.send('login working');
  });
  
  
  router.get('/info', function (req, res) {
  
  });
  module.exports = router;
  </code></pre>
  
  <p>I have tried to access the login subdomain at the following urls:</p>
  
  <pre><code>http://login.localhost
  http://login.localhost:3000
  http://login.localhost.com
  http://login.localhost.com:3000
  </code></pre>
  
  <p>Any clarification or assistance appreciated.</p>