Updating to redirect to correct domain
This commit is contained in:
@@ -7,6 +7,10 @@ const app = express();
|
||||
|
||||
// Handle requests for the root page by serving the static index.html from the views folder
|
||||
app.get("/", function(req, res) {
|
||||
if (!req.headers['x-real-host'] && req.headers.host.includes('glitch.me')) {
|
||||
return res.redirect('https://www.jasonsplant.ml' + req.url);
|
||||
}
|
||||
|
||||
res.sendFile(__dirname + "/views/index.html");
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ const twit = require('twit')
|
||||
require('dotenv').config({path: path.join(__dirname, '../../.env')})
|
||||
|
||||
const alert = (type) => {
|
||||
console.log('Alert triggered for type: ' + type)
|
||||
var tweet = false
|
||||
|
||||
switch(type) {
|
||||
|
||||
@@ -54,7 +54,7 @@ const Readings = sequelize.define('readings', {
|
||||
// If the first low reading was more than 4 days ago, send an alert
|
||||
if (lowtriggered > fourdays) {
|
||||
// Send alert that water is needed
|
||||
message('needwater')
|
||||
message('wantwater')
|
||||
|
||||
// Flag that an alert has been sent
|
||||
Settings.update({ value: new Date().toISOString() }, { where: { key: 'alert' } })
|
||||
|
||||
Reference in New Issue
Block a user