if (Meteor.isServer) {
HTTP.call('GET', 'https://igdbcom-internet-game-database-v1.p.mashape.com/games/?fields=name&limit=10&offset=0&order=release_dates.date%3Adesc&search=zelda', {
headers: {
'X-Mashape-Key': 'thisismykey',
'Accept': 'application/json',
},
}, function (error, response) {
if (error) {
console.log(error);
} else {
console.log(response);
}
});
}
Or, as this needs to be run on the server, put the code into a server-only file and remove the isServer test. Also, use sync-style coding and the short-form GET: