Skip to content

ossgroupp/elasticloadbalancer-express-force-https

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

HTTPS redirect for an Express webserver running behind a Elastic Load Balancer

This package makes it easy to force HTTPS using Express. Since HTTPS is faster than HTTP. The package is generic but was built for the OSSPIM React Commerce boilerplate.

Install

yarn add @osspim/elasticloadbalancer-express-force-https

Usage

const express = require('express');
const forceHttps = require('@osspim/elasticloadbalancer-express-force-https');

const server = express();
server.use(forceHttps());

Options

Pass an optional options object if needed

stripWWW (boolean)

Optional

Strip the leading www. from the host for both https and http requests

redirectHostnames (object(from (string), to (string)))

Optional

Redirect to a given hostname. Example from old-site.com to new-site.com:

redirectHostnames: {
    'old-site.com': 'new-site.com'
}

elasticloadbalancer-express-force-https

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published