diff --git a/node/statusbot.js b/node/statusbot.js index e12f160..9e72970 100644 --- a/node/statusbot.js +++ b/node/statusbot.js @@ -7,6 +7,7 @@ var moment = require('moment'); var SnmpMac = require("./snmp-mac"); var IpPoll = require("./ip-poll"); var routes = require("./routes"); +var path = require('path'); var spaceanswer = { api: "0.13", @@ -116,11 +117,11 @@ app.get('/api/usercount', function (req, res) { }); app.get('/api/simple/image', function (req, res) { if(spaceanswer.state.open == true) { - res.sendfile('img/green.png'); + res.sendfile(path.resolve(__dirname, 'public/img/green.png')); } else if(spaceanswer.state.open == false) { - res.sendfile('img/red.png'); + res.sendfile(path.resolve(__dirname, 'public/img/red.png')); } else { - res.sendfile('img/yellow.png'); + res.sendfile(path.resolve(__dirname, 'public/img/yellow.png')); } });