I'm struggling with something here a bit. I've got some client-side code that requests to user to enter some data into a form.
I want to use this data (just two integer variables) on the server side.
How do I define these variables and access them?
I'm struggling with something here a bit. I've got some client-side code that requests to user to enter some data into a form.
I want to use this data (just two integer variables) on the server side.
How do I define these variables and access them?
you have to call a server side code from the client side, and pass the values, when you call the serverside code. Example:
function someClientSide(){
//do smt here
let v1 = foo
let v2 = bar
Meteor.call("updateTwoVariables", v1, v2)
}
Some resource for api methods: https://docs.meteor.com/api/methods.html
Meteor.methods({ updateTwoVariables(v1, v2){ console.log(v1, v2) } })