mirror of
https://github.com/Raghu-Ch/ReactWeather.git
synced 2026-02-10 11:03:02 -05:00
Prep repo for Heroku
This commit is contained in:
12
server.js
12
server.js
@@ -2,9 +2,17 @@ var express = require('express');
|
||||
|
||||
// Create our app
|
||||
var app = express();
|
||||
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);
|
||||
}
|
||||
});
|
||||
app.use(express.static('public'));
|
||||
|
||||
app.listen(3000, function () {
|
||||
console.log('Express server is up on port 3000');
|
||||
app.listen(PORT, function () {
|
||||
console.log('Express server is up on port ' + PORT);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user