switched to meteor.js for cloud solution

This commit is contained in:
Senad Uka
2015-12-27 06:26:48 +01:00
parent 5b8282935f
commit 2ef3814c0c
20 changed files with 275 additions and 25 deletions

24
app/server/startup.js Normal file
View File

@@ -0,0 +1,24 @@
if (Meteor.isServer) {
Meteor.startup(function() {
// code to run on server at startup
});
// Global API configuration
var Api = new Restivus({
useDefaultAuth: true,
prettyJson: true
});
Api.addRoute('temperatures', {
authRequired: false
}, {
post: function() {
Temperatures.insert({
value: parseFloat(this.bodyParams.value),
owner: this.bodyParams.owner,
created_at: new Date()
});
return [];
}
});
}