From a43099adf39d5142c635f1e48647ff3b11a594e7 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Sun, 14 Feb 2016 16:34:11 +0100 Subject: [PATCH] fixed api problems --- app/server/api.js | 2 ++ controller/config/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/server/api.js b/app/server/api.js index 815fc02..2c0cf3d 100644 --- a/app/server/api.js +++ b/app/server/api.js @@ -1,5 +1,6 @@ // Global API configuration var Api = new Restivus({ + version: 'v1.0', useDefaultAuth: true, prettyJson: true }); @@ -8,6 +9,7 @@ Api.addRoute('sensorData', { authRequired: false }, { post: function() { + console.log("Body params", this.bodyParams); SensorData.insert({ temperatureValue: parseFloat(this.bodyParams.temperatureValue), humidityValue: parseFloat(this.bodyParams.humidityValue), diff --git a/controller/config/__init__.py b/controller/config/__init__.py index 68d0971..6a6c197 100644 --- a/controller/config/__init__.py +++ b/controller/config/__init__.py @@ -1,9 +1,9 @@ GPIO_PIN_DHT = 4 # BCM -SENSORDATA_URL = 'http://tfm.meteor.com/api/sensorData' +SENSORDATA_URL = 'http://tfm.meteor.com/api/v1.0/sensorData' GPIO_PIN_TANKFULL = 20 # BCM GPIO_PIN_VALVE = 21 # BCM -API_BASE_URL = 'http://tfm.meteor.com/api' +API_BASE_URL = 'http://tfm.meteor.com/api/v1.0' CONTROLLER_ID = '120' # every controller must have a different one STATE_FILE = '/var/run/controller_state'