I am trying to access the remote server API and must make an ajax call. It is best if this is done on the server side so as not to violate the API keys. How can I do this with a meteor?
If this is a leisure API, you probably want to use Meteor.http.post (docs here ). Sort of:
Meteor.http.post
Meteor.http.post(API_URL, {foo: 'bar', other: 'data'}, function(err, result) { if (!err) // do something with the result. });
It also works on the client side.
The current method seems to be via the http package.
First add it to your project as follows: meteor add http . Then you can use it as follows:
meteor add http
var result = HTTP.call("GET", "http://api.twitter.com/xyz", {params: {user: userId}});