2015-12-27 06:26:48 +01:00
|
|
|
if (Meteor.isServer) {
|
|
|
|
|
Meteor.startup(function() {
|
|
|
|
|
// code to run on server at startup
|
2016-02-14 10:34:54 +01:00
|
|
|
SyncedCron.start();
|
2015-12-27 06:26:48 +01:00
|
|
|
});
|
|
|
|
|
|
2016-02-14 10:34:54 +01:00
|
|
|
|
2016-03-26 07:11:52 +01:00
|
|
|
|
|
|
|
|
|
2015-12-27 06:26:48 +01:00
|
|
|
// Global API configuration
|
|
|
|
|
var Api = new Restivus({
|
|
|
|
|
useDefaultAuth: true,
|
|
|
|
|
prettyJson: true
|
|
|
|
|
});
|
|
|
|
|
|
2016-03-26 07:11:52 +01:00
|
|
|
// Api.addRoute('sensorData', {
|
|
|
|
|
// authRequired: false
|
|
|
|
|
// }, {
|
|
|
|
|
// post: function() {
|
|
|
|
|
// 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-01-24 09:12:10 +01:00
|
|
|
|
2016-02-14 10:34:54 +01:00
|
|
|
|
2015-12-27 06:26:48 +01:00
|
|
|
}
|