When to use the Meteor method against normal function?

I, I think, have a pretty simple question. I am interested in Meteor, especially when I define server functions that I want the client to be able to call when I use the method against a normal function? Why can't I use a global function in my Meteor server code instead of defining a Meteor method?

thank!

+4
source share
1 answer

Functions defined only by the server are available only for the server code (even if they are defined globally). For example, if you have a function defined in server/util.js, it will not be available to the client.

, , , server client, . lib.

, , , . :

  • URL-
  • , (- minimongo)

- ( , ), .

+3

Source: https://habr.com/ru/post/1532490/


All Articles