WorldBank-API
Wolrbank REST API use Laravel Framework for getting data from worldbank about lending types and income levels in every country in world. Currentyl for this example authentication access is saved in sqlite database.
Requirements
Installation
- Clone the repository locally
- Install depedencies with composer Install
- Run web server:
php artisan serve
- Access the web in address:
127.0.0.1:8000
Authentication
For authentication when accessing API Endpoint in this example, you can use:
- username:
admin@mail.com
- password:
admin123
How to run PHPUnit Test
- Install PHPUnit using phar or composer. Refer to this for installation details.
- Go to project root and type the following command:
phpunit
. This will execute all tests inTests
directory.
How to run API Endpoint Test Use dredd
- Make sure you have nodejs >= 4 and latest npm installed
- Install dredd via npm:
npm install -g dredd@3.4.1
- Install dredd-hooks-php in root project:
composer require ddelnano/dredd-hooks-php:~1.0.0
- Go to project root and type the following command:
dredd
This will execute all tests in API Endpoint in fileapiary.apib
from Apiary Docs
API Documentation
For getting information about the use of API Endpoint, please refer to this: WorldBank-API Documentation