From a3b0982f19d0938d40eca97df2656abbc109b6c0 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Tue, 17 Nov 2015 10:52:30 +0000 Subject: [PATCH] trying to persist the db again --- routes/temp.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/routes/temp.js b/routes/temp.js index 3f96208..dfeca41 100644 --- a/routes/temp.js +++ b/routes/temp.js @@ -58,6 +58,8 @@ router.get('/', function(req, res, next) { var t = req.query; + console.log('t:'); + console.log(JSON.stringify(t)); if (req.query != {} && req.query.temp != null) { // createDB(); @@ -77,17 +79,31 @@ router.get('/', function(req, res, next) { + + + +}); + +router.get('/reading', function(req, res, next) { + var now = new Date(); + + var t = req.query; + + console.log('t:'); + console.log(JSON.stringify(t)); + + res.writeHead(200, {"ContentType": "application/json"}); + //res.send(JSON.stringify(t)); + res.end(JSON.stringify({})); +}); + + router.post('/', function(req, res, next) { "use strict"; console.log('POST'); }); -}); - - - - router.get('/all', function(req, res, next) { "use strict"; console.log('Selecint all..');