Files
old-tfm/app/server/startup.js

31 lines
634 B
JavaScript
Raw Permalink Normal View History

if (Meteor.isServer) {
Meteor.startup(function() {
// code to run on server at startup
2016-02-14 10:34:54 +01:00
SyncedCron.start();
});
2016-02-14 10:34:54 +01:00
// Global API configuration
var Api = new Restivus({
useDefaultAuth: true,
prettyJson: true
});
2015-12-29 23:25:11 +01:00
Api.addRoute('sensorData', {
authRequired: false
}, {
post: function() {
2015-12-29 23:25:11 +01:00
SensorData.insert({
temperatureValue: parseFloat(this.bodyParams.temperatureValue),
humidityValue: parseFloat(this.bodyParams.humidityValue),
tankFull: this.bodyParams.tankFull,
owner: this.bodyParams.owner,
created_at: new Date()
});
return [];
}
});
2016-02-14 10:34:54 +01:00
}