1
0
mirror of https://api.glitch.com/git/presence-button synced 2024-12-05 02:37:30 +00:00

🚨🐴 Checkpoint

./server.js:933874/25
This commit is contained in:
Glitch (hello-express) 2019-11-03 12:08:59 +00:00
parent 0845a22b8d
commit 28f4460d27

View File

@ -30,7 +30,7 @@ app.get("/img", (req, res) => {
}
});
app.get("/api", (req, res) => {
res.send(fuzIsOpen && Date() - 5 * 1000 < lastSeen)
res.send(fuzIsOpen && new Date().getTime() - 5 * 1000 < lastSeen.getTime())
});
// http://expressjs.com/en/starter/basic-routing.html
@ -38,7 +38,7 @@ app.get("/status", (req, res) => {
if (req.query.password !== process.env.PASSWORD) {
return res.sendStatus(401);
}
fuzIsOpen = req.query.fuzisopen === "1";
fuzIsOpen = req.query.fuzisopen == "1";
lastSeen = Date();
try {
fs.writeFileSync(db, JSON.stringify({ fuzIsOpen, lastSeen }));