try to add a image api
This commit is contained in:
parent
f4404dab04
commit
156616ebcf
|
@ -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'));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue