surls is a connect middleware to ensure requests are switched between HTTP and HTTPS based on a config.
npm install surls
The first thing you must do is call
configure to specify which URLs should be secured.
You can optionally specify the HTTP and HTTPS port numbers to use.
var surls = ;surls;
URLs that are to be forced to HTTPS should be specified in the array passed to
You can specify an exact URL match using a string or provide a regex that will be tested against the current request URL.
You can also use an asterisk to indicate that all URLs should be forced to HTTPS.
Only requests to
/account will be forced to HTTPS, all other requests will be forced to HTTP.
/secure9 will be forced to HTTPS, all other requests will be forced to HTTP.
All requests will be forced to HTTPS.
var fs = ;var http = ;var https = ;var express = ;var surls = ;var options =key: fscert: fs;surls;var app = ;app;app;app;app;app;app;http;https;