diff --git a/node/public/js/app.js b/node/public/js/app.js index 0fc24e7..943546e 100644 --- a/node/public/js/app.js +++ b/node/public/js/app.js @@ -75,7 +75,7 @@ gpower = new JustGage({ id: "gauge", value: 0, min: 0, - max: 60000, + max: 30000, title: " ", label: "Watt", showMinMax: false diff --git a/node/statusbot.js b/node/statusbot.js index 3fc1353..da2194f 100644 --- a/node/statusbot.js +++ b/node/statusbot.js @@ -116,22 +116,12 @@ app.use(flash()); app.get('/api/spaceapi/v13', function (req, res) { - res.setHeader("Access-Control-Allow-Origin", "*"); - res.setHeader("Cache-Control", "no-cache"); res.send(spaceanswer); }); app.get('/api/simple/v2', function (req, res) { - res.setHeader("Access-Control-Allow-Origin", "*"); - res.setHeader("Cache-Control", "no-cache"); res.send(simpleanswer); }); app.get('/api/usercount', function (req, res) { - res.setHeader("Access-Control-Allow-Origin", "*"); - res.setHeader("Cache-Control", "no-cache"); - - //TODO: respect query params "start", "end", "interval" (s) and "limit" (like Xively) - // maybe skip "interval" if code gets too complex :) - ippoll.getHistory("-inf", "+inf", function (data) { usercountanswer.datapoints.length = 0; usercountanswer.at = simpleanswer.lastchange; @@ -139,12 +129,8 @@ app.get('/api/usercount', function (req, res) { usercountanswer.datapoints = data; res.send(usercountanswer); }); - }); app.get('/api/simple/image', function (req, res) { - res.setHeader("Access-Control-Allow-Origin", "*"); - res.setHeader("Cache-Control", "no-cache"); - if (spaceanswer.state.open == true) { res.sendfile(path.resolve(__dirname, 'public/img/green.png')); } else if (spaceanswer.state.open == false) { @@ -158,8 +144,7 @@ app.get('/db', routes.db); app.post('/form', routes.form); app.get('/', routes.index); - -server.listen(3000, '0.0.0.0'); +server.listen(3000, 'localhost');