innmind/rest-server
最新稳定版本:8.1.0
Composer 安装命令:
composer require innmind/rest-server
包简介
Library to easily expose REST APIs
README 文档
README
This library contains a set of tools to define, validate, extract and expose resources through http in a REST manner.
Installation
Via composer:
composer require innmind/rest-server
Usage
use function Innmind\Rest\Server\bootstrap; use Innmind\Rest\Server\Gateway; use Innmind\Immutable\Map; $services = bootstrap( new Map('string', Gateway::class), require '/path/to/resources/mapping.php' ); $services['routes']; // provides all the routes available for the definitions you provided // action controllers $services['controller']['create']; $services['controller']['index']; $services['controller']['get']; $services['controller']['remove']; $services['controller']['update']; $services['controller']['link']; $services['controller']['unlink']; // controller to output the resource definition $services['controller']['options']; // controller to expose links to all the resources definitions $services['controller']['capabilities'];
The gateways are the bridges between this component and your domain. The definition handling which resource is handled by which gateway is done in the resources mapping where a resource can only be managed by one gateway. Take a look at fixtures/mapping.php to understand how to define your resources.
统计信息
- 总下载量: 24.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-25