JSPM

@crystallize/elasticloadbalancer-express-force-https

2.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53
  • Score
    100M100P100Q84429F
  • License ISC

Express middleware that will do a 301 redirect if the Elastic Load Balancer adds a x-forwarded-proto=http to the request headers

Package Exports

  • @crystallize/elasticloadbalancer-express-force-https

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@crystallize/elasticloadbalancer-express-force-https) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

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