express-subdomains

subdomain support for express

npm install express-subdomains
7 downloads in the last week
116 downloads in the last month

express-subdomains

Build Status

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

Example


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 (req, res, next) {
  // ..
})

app.listen()

`

Tests

npm install mocha -g and make test

Install

npm install express-subdomains

License

MIT

npm loves you