Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. /*
  2. Meteor allows you to store functions on the server for handling things like data.
  3. This is the server-side component to the Meteor.call() example in add-taco.js.
  4. */
  5.  
  6. Meteor.methods({
  7. // Define our method. Note, we're passing an argument for the tacoToInsert value we passed to our Meteor.call() method.
  8. 'addTaco': function(tacoName){
  9. // Here we do our insert again.
  10. Tacos.insert({
  11. taco: tacoName
  12. }, function(error){
  13. if (error) {
  14. // We can toss an error to the user if something fudges up.
  15. return error.reason;
  16. }
  17. });
  18. }
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement