express-secure-only

Ensure your express connections only run over HTTPS.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
express-secure-only
200.2.18 years ago8 years agoMinified + gzip package size for express-secure-only in KB

Readme

express-secure-only
Express middleware to ensure you're running over HTTPS.
build status coverage license version downloads
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'
}));