I have build a server with express.js and part of it looks like this:
app.get("/api/stuff", (req, res) => {
axios.get('http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b1b15e88fa797225412429c1c50c122a1').then(function(response){
res.send(response);
console.log('response=',response);
})
});
When I hit 'api/stuff' it returns an error:
(node:1626) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Converting circular structure to JSON
How can I return the json from my endpoint?