Hello, I am still pretty new to Meteor. Recently I got access to an API that I have been wanting to use for some time. I successfully connected using the HTTP package. But am now having issues transferring that data to the client. I basically want to perform a call on the server, then send that to the client and display it on the web page. If i run what I have right now, I get the data expected posted back into my terminal. I have tried using the Meteor.method, but to no avail. Any help is appreciated. Here is what I have so far.
if (Meteor.isServer) {
var devId = "XXX";
var authKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
var utcTimestamp = new moment().utc().format("YYYYMMDDHHmmss");
var signature = CryptoJS.MD5(devId + "createsession" + authKey + utcTimestamp).toString();
HTTP.call( 'GET', 'http://api.smitegame.com/smiteapi.svc/createsessionjson/' + devId + '/' + signature + '/' + utcTimestamp, {
}, function( error, response ) {
if ( error ) {
console.log( error );
} else {
console.log( response );
var sessionId = response.data.session_id;
}
console.log("this is my sessionId " + sessionId);
var signature = CryptoJS.MD5(devId + "getplayer" + authKey + utcTimestamp).toString();
HTTP.call( 'GET', 'http://api.smitegame.com/smiteapi.svc/getplayerjson/' + devId + '/' + signature + '/' + sessionId + '/' + utcTimestamp + '/' + 'Truextacy', {
}, function( error, response ) {
if ( error ) {
console.log( error );
} else {
console.log( response );
}
});
}); //ends session
} //ends isServer