Skip to content

API to build and get data about COVID in a custome format

Notifications You must be signed in to change notification settings

anymus0/covid-school-growth-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Client

There is an Angular SPA client you can use with this API!

covid-school-growth-api

API to build and get data about COVID in a custome format

ENV variables

  • DB_URI=your_MongoDB_connection_string
  • PORT=your_API_server_port
  • NODE_ENV=production (prod mode)

Routes:

POST /datamutate/createDBmodel

  • this route builds the database, from 2020. Sept. 01. to the current date with Date.now()
  • confirmation header MUST BE included with the value: true or allow, eg.: 'confirmation': 'true' or 'confirmation': 'allow'
    (this is checked by the allowRebuild middleware)

POST /datamutate/addLatestStatus

  • this will create the latest status update in MongoDB (daily updates)
  • 2 conditions have to be met: it doesn't exist already and the new update is avaliable
  • this route needs to be automated! For example with a cronjob:
    • 1 8 * * * /usr/bin/curl --silent -X POST https://your-api-domain.com/datamutate/addLatestStatus >/dev/null 2>&1

PUT /datamutate/updateLatestStatus

  • this will update the latest status update in MongoDB if the COVID API has a newer status
  • client has a functionality to access this route
  • this route needs to be automated! For example with a cronjob:
    • 1 19 * * * /usr/bin/curl --silent -X PUT https://your-api-domain.com/datamutate/updateLatestStatus >/dev/null 2>&1

GET /clientdata/getAllStatuses

  • gets an array of every avaliable statuses found in MongoDB

GET /clientdata/getDailyCases

  • gets the number of new cases for each day

About

API to build and get data about COVID in a custome format

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages