I am trying to use a Node.JS application to make and receive API requests. It does a get request to another server using Axios with data it receives from an API call it rece
I made an empty array before calling the axios get and after .then(function(response)) pushed the necessary data in the array at the end of the function returned the array
function axiosTest () {
var strr = [];
axios.get(url)
.then(function(response){
strr.push(response.data);
})
.catch(function(error){
console.log(error);
});
return strr;
}