Skip to content

Commit

Permalink
Update query
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Whitney committed Nov 7, 2019
1 parent 38870c7 commit 841cba0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ app.set('port', port);

function requireHTTPS(req, res, next) {
// The 'x-forwarded-proto' check is for Heroku
// if (!req.secure && req.get('x-forwarded-proto') !== 'https' && isProduction) {
// return res.redirect('https://' + req.get('host') + req.url);
// }
if (!req.secure && req.get('x-forwarded-proto') !== 'https' && isProduction) {
return res.redirect('https://' + req.get('host') + req.url);
}
next();
};

Expand Down
2 changes: 1 addition & 1 deletion src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const getIpAddress = req => {
}

const getCurrentTemps = async (req, res) => {
const roomData = await db.query(`SELECT DISTINCT ON (temps.ip) temps.ip, temp, name, timestamp FROM temps INNER JOIN rooms ON rooms.ip = temps.ip ORDER BY temps.ip DESC`);
const roomData = await db.query(`SELECT DISTINCT ON (temps.ip) temps.ip, temp, name, timestamp FROM temps INNER JOIN rooms ON rooms.ip = temps.ip`);
res.status(200).json(roomData.rows);
};

Expand Down

0 comments on commit 841cba0

Please sign in to comment.