Realtime COVID-19 tracker API, since the pandemic I wanted to track each cases in realtime using serverless architecture, which will eliminate the need for server.
Before following any step below, be sure to have serverless connected to your AWS account, and all your crediential are ready before deploying this serverless application.
- In your preferred project directory, run
git clone https://github.com/ericz99/serverless-covid19.git .
. - In your root directory please run
npm install
to install all necessary dependencies. - OPTIONAL: Only if you didn't install serverless framework, please run
npm install -g serverless
. - Next, configure your project settings, by running
serverless
You should be prompt with questions, so just fill it out. - Finally, once you finish with everything above, you can now run
serverless deploy
. - You should now have a fully functional serverless api application. Please redirect to the URL that is being displayed on your CLI.
This will be using API Gateway as an event trigger, which will trigger the lambda function, aka our express server. After successfully deploying your serverless application, you should get the production endpoint for your API Gateway.
GET
: Get all cases
{
"cases": "10,802,849",
"deaths": "518,921",
"recovered": "5,938,954"
}
GET
: Get all cases by countries
[
{
"country": "World",
"totalCases": "10,802,849",
"newCases": "+7,749",
"newDeaths": "518,921",
"totalRecovered": "+863",
"activeCases": "5,938,954",
"critical": "+3,960",
"casesPerOneMillion": "4,344,974",
"deathsPerOneMillion": "57,959",
"totalTests": "1,386",
"testsPerOneMillion": "66.6"
},
...
]
GET
: Get cases by country
{
"country": "China",
"totalCases": "83,542",
"newCases": "+5",
"newDeaths": "4,634 ",
"totalRecovered": 0,
"activeCases": "78,499",
"critical": "+12",
"casesPerOneMillion": "409",
"deathsPerOneMillion": "7",
"totalTests": "58",
"testsPerOneMillion": "3"
}
Eric Zhang
1.0.0
This project is licensed under the MIT License - see the LICENSE file for details