From f44ebd78e00db0d120608a65d3da3dff92c89ac2 Mon Sep 17 00:00:00 2001 From: Tim Windelschmidt Date: Tue, 27 Sep 2016 21:33:30 +0200 Subject: [PATCH] Added Image.png for the Wiki --- node/statusbot.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/node/statusbot.js b/node/statusbot.js index d59619d..3c760c0 100755 --- a/node/statusbot.js +++ b/node/statusbot.js @@ -136,7 +136,8 @@ app.get('/api/usercount', function (req, res) { res.send(usercountanswer); }); }); -app.get('/api/simple/image', function (req, res) { + +function getstatusImage(req, res) { if (spaceanswer.state.open == true) { res.sendFile(path.resolve(__dirname, 'public/img/green.png')); } else if (spaceanswer.state.open == false) { @@ -144,6 +145,14 @@ app.get('/api/simple/image', function (req, res) { } else { res.sendFile(path.resolve(__dirname, 'public/img/yellow.png')); } +} + +app.get('/api/simple/image', function (req, res) { + getstatusImage(req, res); +}); + +app.get('/api/simple/image.png', function (req, res) { + getstatusImage(req, res); }); app.get('/db', routes.db);