final-gene / rest-api-entry-point-module
Provides a REST resource which represents an entry point of the API.
1.1.1
2016-04-02 12:36 UTC
Requires
- php: >=5.5.0
- final-gene/uri-template-module: ^1.0
- rize/uri-template: ^0.3.0
- zendframework/zend-config: ^2.5
- zendframework/zend-modulemanager: ^2.5
- zendframework/zend-mvc: ^2.5
- zendframework/zend-servicemanager: ^2.5
- zfcampus/zf-api-problem: ^1.1
- zfcampus/zf-hal: ^1.3
- zfcampus/zf-rest: ^1.2
Requires (Dev)
- final-gene/phing-commons: ^2.2
- phpunit/phpunit: ^4.8
- zendframework/zend-filter: ^2.5
- zendframework/zend-form: ^2.5
- zendframework/zend-i18n: ^2.5
- zendframework/zend-inputfilter: ^2.5
- zendframework/zend-log: ^2.5
- zendframework/zend-serializer: ^2.5
- zendframework/zend-stdlib: ^2.5
- zendframework/zend-test: ^2.5
- zendframework/zend-validator: ^2.5
This package is auto-updated.
Last update: 2024-11-10 22:58:29 UTC
README
Provides a REST resource which represents an entry point of the API.
Installation
After composer is available in your path you are ready to install this module.
composer require final-gene/rest-api-entry-point-module
Then add FinalGene\RestApiEntryPointModule
to your application config file.
Configuration
You may now configure a virtual entry point controller (e.g. FinalGene\RestApiEntryPointModule\EntryPointController
)
which will actually map the FinalGene\RestApiEntryPointModule\Resource\EntryPointResource
as listener.
Here is an example for a possible REST configuration:
return [
'zf-rest' => [
'FinalGene\RestApiEntryPointModule\EntryPointController' => [
'listener' => FinalGene\RestApiEntryPointModule\Resource\EntryPointResource::class,
'route_name' => 'api/rest',
'collection_name' => null,
'collection_http_methods' => [
'GET',
],
],
],
];
A resulting router configuration could be the following one:
return [
'router' => [
'routes' => [
'api' => [
'type' => 'literal',
'options' => [
'route' => '/api',
'child_routes' => [
'rest' => [
'type' => 'literal',
'options' => [
'route' => '/rest',
'defaults' => [
'controller' => 'FinalGene\RestApiEntryPointModule\EntryPointController',
],
],
],
],
],
],
],
];