created and tested server side water control
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
if (Meteor.isServer) {
|
||||
Meteor.startup(function() {
|
||||
// code to run on server at startup
|
||||
|
||||
return Meteor.methods({
|
||||
clearLog: function() {
|
||||
return SensorData.remove({});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Global API configuration
|
||||
@@ -15,11 +21,13 @@ if (Meteor.isServer) {
|
||||
post: function() {
|
||||
SensorData.insert({
|
||||
temperatureValue: parseFloat(this.bodyParams.temperatureValue),
|
||||
humidityValue: parseFloat(this.bodyParams.humidityValue),
|
||||
humidityValue: parseFloat(this.bodyParams.humidityValue),
|
||||
owner: this.bodyParams.owner,
|
||||
created_at: new Date()
|
||||
});
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user