I want to do an API request and display the body in a table on my site. I'm using Node.JS, React and Request. This is my code:
var requestResult = Request.get('https://test.ipdb.io/api/v1/assets/?search=asdf', (err, res, body) => {
return body;
});
This is obviously not working. I can console.log(body), but I want the API response to be available outside the callback function. Is that possible?