2.0.0 • Published 7 years ago

expressjs-force-https v2.0.0

Weekly downloads
25
License
MIT
Repository
github
Last release
7 years ago

expressjs-force-https

A simple express.js middleware that redirects incoming unencrypted HTTP requests to HTTPS.

Installation

npm install expressjs-force-https

Usage

const express = require("express");
const forceHTTPS = require("expressjs-force-https").forceHTTPS;
const app = express();

//Redirecting incoming unencrypted http requests
app.use(forceHTTPS);

app.listen(3000, () => {
    console.log(`Server Running...`);
});

To force HTTPS on a Node App Service on Azure:

const forceAzureHTTPS = require("expressjs-force-https").forceAzureHTTPS;

app.use(forceAzureHTTPS);