try to add a image api

This commit is contained in:
Lucas Pleß 2014-07-06 01:42:11 +02:00
parent f4404dab04
commit 156616ebcf
1 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,7 @@ var moment = require('moment');
var SnmpMac = require("./snmp-mac"); var SnmpMac = require("./snmp-mac");
var IpPoll = require("./ip-poll"); var IpPoll = require("./ip-poll");
var routes = require("./routes"); var routes = require("./routes");
var path = require('path');
var spaceanswer = { var spaceanswer = {
api: "0.13", api: "0.13",
@ -116,11 +117,11 @@ app.get('/api/usercount', function (req, res) {
}); });
app.get('/api/simple/image', function (req, res) { app.get('/api/simple/image', function (req, res) {
if(spaceanswer.state.open == true) { 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) { } else if(spaceanswer.state.open == false) {
res.sendfile('img/red.png'); res.sendfile(path.resolve(__dirname, 'public/img/red.png'));
} else { } else {
res.sendfile('img/yellow.png'); res.sendfile(path.resolve(__dirname, 'public/img/yellow.png'));
} }
}); });