REST backend for Yii2 applications., (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
$ composer require oteixido/yii2-rest-backend "*"
or add, (*4)
"oteixido/yii2-rest-backend": "*"
to the require section of your composer.json
file., (*5)
Configuration
To use this extension, simply add the following code in your application configuration:, (*6)
return [
//....
'components' => [
'httpClient' => [
'class' => '\oteixido\rest\http\HttpClient',
'baseUrl' => 'https://localhost.localdomain/api/v1',
'username' => 'username', // Default no username
'password' => 'password', // Default no password
'timeout' => 5, // Default 10 seconds
'sslVerify' => false, // Default true
],
],
];
Testing
Create docker image yii2-rest-backend for testing environment., (*7)
$ docker build . --tag yii2-rest-backend
$ docker run -it --rm -v "$PWD":/app -w /app yii2-rest-backend composer install
Execute tests., (*8)
$ docker run -it --rm -v "$PWD":/app -w /app yii2-rest-backend ./vendor/bin/codecept run --coverage
License
GNU General Public License v3.0, (*9)