From 271c453ff0c0d6ea2e3ca0d5986bd94916c91a35 Mon Sep 17 00:00:00 2001 From: "Glitch (hello-express)" Date: Sun, 3 Nov 2019 14:49:00 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=82=F0=9F=98=85=20Checkpoint=20./.glit?= =?UTF-8?q?ch-assets:933874/481=20./server.js:933874/3686?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .glitch-assets | 2 ++ server.js | 7 ++++--- views/closed.svg | 1 + views/open.svg | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 views/closed.svg create mode 100644 views/open.svg diff --git a/.glitch-assets b/.glitch-assets index 954626f..d66bad0 100644 --- a/.glitch-assets +++ b/.glitch-assets @@ -4,3 +4,5 @@ {"uuid":"adSBq97hhhpFNUna","deleted":true} {"uuid":"adSBq97hhhpFNUnb","deleted":true} {"uuid":"adSBq97hhhpFNUnc","deleted":true} +{"name":"andre-benz-231286-unsplash.jpg","date":"2019-11-03T14:43:20.698Z","url":"https://cdn.glitch.com/11921fdd-f2f8-4bee-87ed-e6d62732b3b3%2Fandre-benz-231286-unsplash.jpg","type":"image/jpeg","size":5873105,"imageWidth":4236,"imageHeight":6354,"thumbnail":"https://cdn.glitch.com/11921fdd-f2f8-4bee-87ed-e6d62732b3b3%2Fthumbnails%2Fandre-benz-231286-unsplash.jpg","thumbnailWidth":220,"thumbnailHeight":330,"uuid":"uiePUtoXJG2jTqB2"} +{"uuid":"uiePUtoXJG2jTqB2","deleted":true} diff --git a/server.js b/server.js index b80abb1..7d10f35 100644 --- a/server.js +++ b/server.js @@ -23,12 +23,13 @@ app.get("/", (req, res) => { // http://expressjs.com/en/starter/basic-routing.html app.get("/img", (req, res) => { - res.sendFile(__dirname + "/views/index.html"); - if (fuzIsOpen && Date() - 2 * 60 * 1000 < lastSeen) { + if (fuzIsOpen && Date() - (2 * 60 * 1000) < lastSeen) { + return res.sendFile(__dirname + "/views/open.svg"); } + res.sendFile(__dirname + "/views/closed.svg"); }); app.get("/api", (req, res) => { - res.send(fuzIsOpen && new Date() - 2 * 60 * 1000 < lastSeen); + res.send(fuzIsOpen && new Date() - (2 * 60 * 1000) < lastSeen); }); // http://expressjs.com/en/starter/basic-routing.html diff --git a/views/closed.svg b/views/closed.svg new file mode 100644 index 0000000..c585212 --- /dev/null +++ b/views/closed.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/views/open.svg b/views/open.svg new file mode 100644 index 0000000..226714e --- /dev/null +++ b/views/open.svg @@ -0,0 +1 @@ + \ No newline at end of file