In order to redirect HTTP to HTTPS in express server, try adding the following lines to your code base.

app.set(‘trust proxy’, 1);
app.use(function(req, res, next) {
if (! req.secure){
res.redirect(“https://” + req.headers.host + req.url);
}
return next();
});