Update middleware for localhost (server.js)

This commit is contained in:
2017-01-15 23:35:28 -08:00
parent 053fbfd90b
commit cd3becc6ea

View File

@@ -6,9 +6,9 @@ const PORT = process.env.PORT || 3000;
app.use(function (req, res, next) {
if (req.headers['x-forwarded-proto'] === 'http') {
next();
} else {
res.redirect('http://' + req.hostname + req.url);
} else {
next();
}
});
app.use(express.static('public'));