Description
The problem When building up a backend API, it is common that we need to fetch data from a... Tagged with node, javascript.
Summary
- The problem When building up a backend API, it is common that we need to fetch data from a third-party API, clean, format and merge them, and then forward it to the front-end.
- The first thought I came up with is to generate an array that contains a range of dates.
- Then I can do a forEach method or a for loop to iterate through the array and make API calls one by one, get the data, push it into a result array, and finally return the result to the front-end.
- In this example, the method will be using is parallel, and it's mainly for flow control: