I just started with nodes and express and I need a little help.
I am trying to get data from an api server (http://api.randomuser.me) and use this data on my view.
I have a api.js file: `var Client = require('node-rest-client').Client; var client = new Client();
client.get("http://api.randomuser.me/", function (data, response){
data = JSON.stringify(data.results);
console.log(data);
});"`
I need to use this variable data in a view ejs. But I just need to know how a set this result in another variable outside the function.
Thanks so much