May 2017
Intermediate to advanced
388 pages
7h 30m
English
To make our app work with methods, we need to create tree methods and move all the edits from the client to the server.
Let's place all the methods in a folder called api on the root of the client. The concept of Methods is very similar to Ajax calls to the server:

On the server, we can define them when on the startup:
Meteor.startup(() => {….. Methods definition}); Meteor.methods({cartInsert: function(product) { CartCollection.insert({ 'title' : product.title, 'price' : product.price, 'inventory' : product.inventory, 'quantity': 1 }); },
In Meteor.methods, we can define all the methods.
Let's start by adding the product
Read now
Unlock full access