Express middleware to redirect all http requests to https.
A simple module to check if the current request is using https. If not, it will redirect to the same route, but using https. It also checks for cases of localhost and disables the redirect if so.
npm i express-force-https
var express = require('express'); var secure = require('express-force-https'); var app = express(); app.use(secure);
MIT, see LICENSE.md for details.