force-secure-express
v1.0.1
Published
Express middleware to redirect insecure http requests to https.
Downloads
527
Maintainers
Readme
Force Secure Express
Description
Express middleware to redirect insecure http requests to https.
Install
npm install force-secure-express --save
Usage
const forceSecure = require("force-secure-express");
const express = require("express");
const app = express();
const port = Number(process.env.PORT) || 3000;
app.use(forceSecure([
"example.com",
"staging.example.com"
]));
app.use(express.static("./public"));
app.get("*", (req, res) => {
res.sendFile("./public/index.html")
});
app.listen(port, () => {
logger.info(`${port} we have liftoff \u{1F680}`)
});