This API will retrieve endpoints for Covid-19 Status, you can add your own record if you are authorized to do it.
- Javascript and Typescript
- Clone the repo on your computer, please make sure you have installed Nodejs, Yarn and Git on your machine.
https://github.com/billiramirez/statistics-covid-api.git
- Install Dependencies
yarn install
- Create a
.env
file in the root of your project, you'll find a.env.example
that will looks this:
X_RAPID_API_HOST=
X_RAPID_API_KEY=
API_X_RAPID_API_URL=
MONGO_USER=
MONGO_PASSWORD=
AUTH_TOKEN=
- Run the Project
yarn start:dev
You need to seed the database with initial data, you can go to http://localhost:4000/v1/statistcs
to sync data, for this endpoint you'll need to be logged in.
If you need to sign up, you can go to: http://localhost:4000/v1/auth/signup
to create your account, and this will provide you a token
you can use for performing this operation.
Then you can try this endpoint http://localhost:4000/v1/statistcs
Since this project is using the Open API Specification along with Express Open APi, this will help you to interact with the endpoints. Having the project running locally you can import the API Documentation in POSTMAN as Link
, paste this URL: http://localhost:4000/v1/openapi.json
and then import it, this will create a collection for you, out of the box with the available endpoints. You'll be ready to go with this setup.
This will generate the Collection for you:
You can also paste that openapi.json url to this URL: https://petstore.swagger.io/
You can deploy this app to your favorite hosting provider, for this demo we're using Heroku, just make sure to provide the environemnt variables