2.4.0 • Published 5 years ago

@crystallize/elasticloadbalancer-express-force-https v2.4.0

Weekly downloads
11,525
License
MIT
Repository
github
Last release
5 years ago

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 Crystallize React Commerce boilerplate.

Install

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

Usage

const express = require('express');
const forceHttps = require('@crystallize/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'
}
2.4.0

5 years ago

2.3.0

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.0.0

6 years ago