express-secure-only
v0.2.1
Published
Ensure your express connections only run over HTTPS.
Downloads
3,055
Readme
express-secure-only
Express middleware to ensure you're running over HTTPS.
Features:
- Redirect requests to their HTTPS equivalents
var express = require('express'),
secure = require('express-secure-only'),
app = express();
app.use(secure());
app.get('/', function(req, res) {
res.status(200).send('Hello world.');
});
app.listen();
Usage with a custom host or port:
app.use(secure({
host: 'localhost:3001'
}));