Closed kart2004 closed 1 month ago
@kart2004 can you please resolve the conflicts and describe the approach in brief. i see while and for loop there what is the use of those loops?
Hi @Yash-Parsana, sorry for the late reply. It uses, practiceapi.geeksforgeeks.org, which is associated with the practice and contest platforms of gfg. From here it fetches the contest data and then sends JSON response in the required format after processing. The while(true) loop is used to continuously fetch data page by page. The for loop is to iterate over all contests, put timestamp for start and end, determine the status ('upcoming' or 'ongoing') . It does this because we need the ongoing data but the past data(from the url) also includes finished contests which we do not want.
This commit fixes #11 : Expose route for gfg contest This is the final result when I tested on local host:
I have made one major change to scheduleController.js in order to add the gfgSchedule function and I've made minor changes elsewhere too ensure the route works