modified to use events, hopefully will fix the crashing particle
This commit is contained in:
parent
3a5cef1262
commit
31ba1ebb94
@ -130,37 +130,21 @@ router.post('/', function (req, res, next) {
|
||||
//t = JSON.parse(t);
|
||||
if(t.hasOwnProperty('data')){
|
||||
logger.debug('We have data');
|
||||
var data = t.data;
|
||||
var s = data.toString();
|
||||
logger.debug(typeof s);
|
||||
logger.debug(s);
|
||||
/*dataJSON = JSON.parse(s);
|
||||
logger.debug(typeof dataJSON);*/
|
||||
/* if (data.hasOwnProperty(temp)) {
|
||||
var data = JSON.parse(t.data.toString());
|
||||
|
||||
if (data.hasOwnProperty(temp)) {
|
||||
logger.log('We have temp! ' + data.temp);
|
||||
}*/
|
||||
|
||||
//dataJSON = JSON.parse(data);
|
||||
//logger.debug(dataJSON);
|
||||
|
||||
/* var data = t.data;
|
||||
dataJSON = JSON.parse(data);
|
||||
if(dataJSON.hasOwnProperty('temp')) {
|
||||
|
||||
busEmitter.emit("saveTempData", {time: now.toJSON(), value: parseFloat(data.temp)});
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.error('No temp data!');
|
||||
}*/
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.error('No data block!');
|
||||
}
|
||||
/*console.log(JSON.stringify(t));
|
||||
if (dataJSON != {} && dataJSON.temp != null) {
|
||||
busEmitter.emit("saveTempData", {time: now.toJSON(), value: parseFloat(dataJSON.temp)});
|
||||
}*/
|
||||
|
||||
res.writeHead(200, {"ContentType": "text/html"});
|
||||
res.end('ok');
|
||||
|
Loading…
Reference in New Issue
Block a user