I'm doing some fetches in a promise and then consolidating my results into a response json. When I console.log it, it prints out as expected, but I'm not sure how to return it as the response.
I have something like this:
router.get('/', function(req, res) {
Promise.all([ fetch(url1); fetch(url2); ]);
}.then(function(responses) {
// Consolidate responses into one data json
console.log(data); // Prints correct object
return response; // This doesn't work
}