Skip to content

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

Notifications You must be signed in to change notification settings

KwabenBerko/expressjs-force-https

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

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);

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published