switched to meteor.js for cloud solution
This commit is contained in:
24
app/server/startup.js
Normal file
24
app/server/startup.js
Normal 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 [];
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user