Thursday, 2 January 2020

Best way to request external API and parse the response

I ma building a small app using Express which will serve as an API. when one of the routes is hit with a GET request, I need to call an external API, get the JSON response of that, pass it to another function to pull out certain bits of data, then send a response back to the API user (my API) with just the bits of data returned from the function.​I can call the external API fine, and send the whole response along as the `res` of my API endpoint but I'm not sure how to pass it to a function first and return the output of that function

Submitted January 02, 2020 at 07:31PM by BrightonTechie

No comments:

Post a Comment