Skip to content

Instantly share code, notes, and snippets.

Created July 19, 2017 21:17
Show Gist options
  • Save anonymous/2f1152117513238f9089bda082bbe2e3 to your computer and use it in GitHub Desktop.
Save anonymous/2f1152117513238f9089bda082bbe2e3 to your computer and use it in GitHub Desktop.
app.use(function(req, res, next) {
if (req.secure){
return next();
}
res.redirect("https://" + req.headers.host + req.url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment