Added humidity sensor data handling
This commit is contained in:
@@ -9,12 +9,13 @@ if (Meteor.isServer) {
|
||||
prettyJson: true
|
||||
});
|
||||
|
||||
Api.addRoute('temperatures', {
|
||||
Api.addRoute('sensorData', {
|
||||
authRequired: false
|
||||
}, {
|
||||
post: function() {
|
||||
Temperatures.insert({
|
||||
value: parseFloat(this.bodyParams.value),
|
||||
SensorData.insert({
|
||||
temperatureValue: parseFloat(this.bodyParams.temperatureValue),
|
||||
humidityValue: parseFloat(this.bodyParams.humidityValue),
|
||||
owner: this.bodyParams.owner,
|
||||
created_at: new Date()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user