express-http-to-https is a node.js package for providing an Express middleware that redirects the client to HTTPS if they attempt to connect over HTTP.
$ npm install --save express-http-to-https
- ignoreHosts: An array of strings of the hostnames on which to not enable the redirect. note: you must include the port here, for example
- ignoreRoutes: An array of strings of the routes on which not to enable the redirect.
- redirectCode: The HTTP status code to return when redirecting. Defaults to 302 "found" can be any status code
var express = ;var app = ;var redirectToHTTPS = redirectToHTTPS// Don't redirect if the hostname is `localhost:port` or the route is `/insecure`app;app;app;app;app;
Max Walker (email@example.com)