From 1d48b8374ec4b4566ef9a56caa5f1a6d07a4c401 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Fri, 12 Feb 2016 16:11:49 +0000 Subject: [PATCH] modified to use events, hopefully will fix the crashing particle --- routes/temp.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/routes/temp.js b/routes/temp.js index fa9508e..2d09e87 100644 --- a/routes/temp.js +++ b/routes/temp.js @@ -131,9 +131,11 @@ router.post('/', function (req, res, next) { if(t.hasOwnProperty('data')){ logger.debug('We have data'); var data = t.data; - if (data.hasOwnProperty(temp)) { + var s = data.toString(); + logger.debug(typeof s); + /* if (data.hasOwnProperty(temp)) { logger.log('We have temp! ' + data.temp); - } + }*/ //dataJSON = JSON.parse(data); //logger.debug(dataJSON); @@ -152,10 +154,10 @@ router.post('/', function (req, res, next) { { logger.error('No data block!'); } - console.log(JSON.stringify(t)); + /*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');