covidAPI icon indicating copy to clipboard operation
covidAPI copied to clipboard

Add yesterdays data to new endpoint

Open joelbduncan opened this issue 4 years ago • 0 comments

Optional Feature

Might not be on your road map but I am using yesterday's data and thought I'd share the update.

This adds yesterday's data without much extra code, every second cycle of the data collection will get yesterday's data. You can half the update time if you wanted the same collection rate on today's data as before this PR.

New endpoints: /yesterday/ Will show all countries yesterdays data /yesterday/{country} Will show individual country data for yesterday

You could change the frequency pretty easily by adjusting the counter. Maybe only get yesterday's data when the counter hits 5 then reset.

Note When testing delete database before first run.

Thanks!

joelbduncan avatar Apr 14 '20 14:04 joelbduncan