aaaand removing the headers to check if it works better
This commit is contained in:
parent
1fbb8a6ace
commit
52aa2837df
|
@ -75,7 +75,7 @@ gpower = new JustGage({
|
|||
id: "gauge",
|
||||
value: 0,
|
||||
min: 0,
|
||||
max: 60000,
|
||||
max: 30000,
|
||||
title: " ",
|
||||
label: "Watt",
|
||||
showMinMax: false
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue