Skip to content

oteixido/yii2-rest-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii2 REST backend License: GPL v3 GitHub version Build Status

REST backend for Yii2 applications.

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require oteixido/yii2-rest-backend "*"

or add

"oteixido/yii2-rest-backend": "*"

to the require section of your composer.json file.

Configuration

To use this extension, simply add the following code in your application configuration:

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.

$ docker build . --tag yii2-rest-backend
$ docker run -it --rm -v "$PWD":/app -w /app yii2-rest-backend composer install

Execute tests.

$ docker run -it --rm -v "$PWD":/app -w /app yii2-rest-backend ./vendor/bin/codecept run --coverage

License

GNU General Public License v3.0

About

REST backend for Yii2 applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages