From 28f4460d2743f7bdeaf4be63efc6fc197ddee4e8 Mon Sep 17 00:00:00 2001 From: "Glitch (hello-express)" Date: Sun, 3 Nov 2019 12:08:59 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=F0=9F=90=B4=20Checkpoint=20./serve?= =?UTF-8?q?r.js:933874/25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 4868673..d6b11c3 100644 --- a/server.js +++ b/server.js @@ -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 }));