DW Morgan Covid
Getting Started
Prerequisites
- PHP
- Composer
- Postgres
Installing
- git clone https://github.com/paulolorenzobasilio/dw-morgan.git
- cd into project dir
- cp .env.example .env
- configure your .env environment
APP_KEY=SECRET_32_STRING_KEY
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=YOUR_DATABASE
DB_USERNAME=YOUR_USERNAME
DB_PASSWORD=YOUR_PASSWORD
- composer install
- php artisan migrate
- php artisan db:seed
Development
Run php -S localhost:8000 -t public
for the server
Usage
Run the server php -S localhost:8000 -t public
Access the endpoint /top/confirmed
http://localhost:8000/top/confirmed?max_results=2&observation_date=2020-01-22
Sample result
{
"observation_date": "2020-01-22",
"countries": [
{
"country": "Mainland China",
"confirmed": 547,
"deaths": 17,
"recovered": 28
},
{
"country": "Japan",
"confirmed": 2,
"deaths": 0,
"recovered": 0
}
]
}