mirror of
https://github.com/Raghu-Ch/ReactWeather.git
synced 2026-02-10 03:03:01 -05:00
Update middleware for localhost (server.js)
This commit is contained in:
@@ -6,9 +6,9 @@ const PORT = process.env.PORT || 3000;
|
|||||||
|
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
if (req.headers['x-forwarded-proto'] === 'http') {
|
if (req.headers['x-forwarded-proto'] === 'http') {
|
||||||
next();
|
|
||||||
} else {
|
|
||||||
res.redirect('http://' + req.hostname + req.url);
|
res.redirect('http://' + req.hostname + req.url);
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
app.use(express.static('public'));
|
app.use(express.static('public'));
|
||||||
|
|||||||
Reference in New Issue
Block a user