mirror of
https://github.com/Raghu-Ch/ReactWeather.git
synced 2026-02-10 03:03:01 -05:00
19 lines
415 B
JavaScript
19 lines
415 B
JavaScript
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'] === 'https') {
|
|
res.redirect('http://' + req.hostname + req.url);
|
|
} else {
|
|
next();
|
|
}
|
|
});
|
|
app.use(express.static('public'));
|
|
|
|
app.listen(PORT, function () {
|
|
console.log('Express server is up on port ' + PORT);
|
|
});
|