1.0.1 • Published 6 years ago

http-to-https v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

node-http-to-https

middleware to redirect http to https

Quickstart

Install:

npm i http-to-https

Include in project:

const https = require('http-to-https');

add middleware:

const app = express();
app.use(https(ignoreHosts, ignorePaths, redirectCode));

example: ignore all ports on localhost and routes under /insecure. Send 301: Moved Permanently status code

const app = express();
app.use(https([/localhost(:\d{1,5})?/], [/\/insecure/], 301));

Defaults

ignoreHosts = []
ignorePaths = []
redirectCode = 302
1.0.1

6 years ago

1.0.0

6 years ago