-
Aggregate
Johns Hopkins CoronaVirus case data
that is available by county to provide information
on CoronaVirus cases for the given State as a whole.
(GET) getHistoricalData(state: string, daysBack: number): StateCoronaInformation
This endpoint returns the cumulative number of CoronaVirus cases and deaths for each day in the range of
daysBack
to the time of calling the API.
StateCoronaInformation {
name: string,
days: DailyCoronaInformation[]
}
DailyCoronaInformation {
mm/dd-1/yy: Day,
mm/dd-2/yy: Day,
...
mm/dd-{daysBack}/yy: Day
}
Day {
cases: number,
deaths: number
}
To run this application, perform the following actions.
- Clone this repo
- Navigate to the repo folder via the command line
- Assuming you have Node installed (if not, go do that!): run `npm i`
- Run `npm run start`
This application will now be running locally. To query the endpoint, use the following url:
- localhost:3000/coronastateinfo/gethistoricaldata
Simply perform an HTTP GET request, with the request body detailed in the API section of this documentation. A curl request would look like the following:
curl --location --request GET 'http://localhost:3000/coronastateinfo/gethistoricaldata' \
--header 'Content-Type: application/json' \
--data-raw '{
"state": "florida",
"daysBack": 2
}'