mirror of
https://api.glitch.com/git/presence-button
synced 2024-11-05 06:37:29 +00:00
🚨🐴 Checkpoint
./server.js:933874/25
This commit is contained in:
parent
0845a22b8d
commit
28f4460d27
@ -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 }));
|
||||
|
Loading…
Reference in New Issue
Block a user