1.0.1 • Published 3 years ago

@valbo/redirect-to-https-middleware v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@valbo/redirect-to-https-middleware

Express middleware that redirects HTTP to HTTPS.

npm (scoped) semantic-release Build Status Coverage Status Known Vulnerabilities

Install

npm install @valbo/redirect-to-https-middleware

Usage

Add this middleware to your express app. To make it work behind a reverse proxy set trust proxy to true:

import { redirectToHttpsMiddleware } from '@valbo/redirect-to-https-middleware';

app.set('trust proxy', true);
app.use(redirectToHttpsMiddleware);

The middleware will redirect any request with the HTTP protocol to the same URL but with the HTTPS protocol, except if the server is localhost or 127.0.0.1.

1.0.1

3 years ago

1.0.0

3 years ago