expressjs/vhost — pull request #4 by PatrickHeneise (2014-07-31 14:22:06+00:00)
Title: Update index.js

The new regex breaks with the old express.vhost and doesn't work for wildcard subdomains (*.mydomain.com). This reverts it to express.vhost regex. Here's a test for `curl dev.mydomain.com:3000`

var connect = require('connect');
var vhost = require('vhost');

var vapp = connect();

vapp.use('/', function (req, res) {
res.end('Hello from Connect!\n');
});
var app = connect();

app.use(vhost('*m.mydomain.com', vapp)); // doesnt work, 404

// app.use(vhost('dev.mydomain.com', vapp)); // works

app.listen(3000);