Specifying a subdomain in the route definition in Express <p>I'm new to ExpressJS and NodeJS in general, so I need directions on how to achieve this effect: </p> <pre><code>app.get('/', 'sub1.domain.com', function(req, res) { res.send("this is sub1 response!"); }); app.get('/', 'sub2.domain.com', function(req, res) { res.send("this is sub2 response!"); } </code></pre> <p>So that when I request <code>sub1.domain.com</code> the first handler reacts and on <code>sub2.domain.com</code> I get response from second handler. I've read some questions on SO about using vhost for this purpose, but I'd be more happy if what I described above worked rather than creating multiple server instances like in vhost. </p>