I\'m trying to reroute http (80) to https (443) in my express app. I\'m using some middle ware to do this. If i go to my https://my-example-
http (80)
https (443)
https://my-example-
var redirectApp = express () , redirectServer = http.createServer(redirectApp); redirectApp.use(function requireHTTPS(req, res, next) { if (!req.secure) { return res.redirect('https://' + req.headers.host + req.url); } next(); }) redirectServer.listen(8080);