simples-redirect is a middleware to redirect connections to a specific protocol.
simpleS 0.7+
Recommended forInstalation
npm install simples-redirect
Usage
var simples = redirect = ; var server = ; server;
Options
headers
: object - Headers to be set to the connection redirect, by default is an empty object
pattern
: regexp or string - Regular expression pattern to match the redirected locations, by default is /^.+$/i
permanent
: boolean - Set status code as 301
for permanent redirects and 302
- otherwise, by default is false
protocol
: 'http' | 'https' - Set the prefered protocol to switch, by default is http