Hey guys, first of all great application!
Second, I'm trying to add a link to the header of my forum via a plugin. This links text will be chosen by what is gets from an external api. To get the information from the external API, I run a request like this:
var request = require('request');
request('http://www.google.com', function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body) // Print the google web page.
}
})
This code is run async afaik, causing the body to be returned undefined until the request is completed.
My question is, how can I get the async body information and use it for the header text.