I'm using Node on AWS Lambda to call an API which gives X results, if more exist, it provides a "next_url" URI to call for the next set of results.
How do I continuously loop, passing the URI to the next iteration of the loop, if next_url is present and terminate if "next_url" is no longer provided?