1.0.0 • Published 7 years ago

bind-host v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

express-bind-host

Bind the available host to Express Server.

Installation

$ npm install express-bind-host --save

Usage

let bindHost = require('express-bind-host');

let app = express();

app.use(bindHost({
  hosts : ['127.0.0.1:3000']
}))
app.use(function(req, res, next) {
  res.json({aa:'bb'})
})

app.listen(3000);
curl http://localhost:3000  #statu -> 403  body -> The domain name is not bound!
curl http://127.0.0.1:3000  #statu -> 200  body -> {aa:'bb'}

License

MIT © Krew