bind-host
v1.0.0
Published
Bind the available host to Express Server.
Downloads
9
Readme
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