express-subdomains

subdomain support for express

express-subdomains

Subdomains are placed at the beginning of a route by default.

 
var subdomains = require('express-subdomains')
    , express = require('express')
    , app = Express.createServer()
 
// example: api.example.com/user -> '/api/user' 
 
subdomains
  .use('api')
  .use('other.vanity.domain')
 
app.use(subdomains.middleware)
 
app.get('/api/user' function (reqresnext) {
  // .. 
})
 
app.listen()
    

npm install mocha -g and make test

npm install express-subdomains

MIT