Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ongr-io/apibundle
ONGR API Bundle
https://github.com/ongr-io/apibundle
Last synced: about 1 month ago
JSON representation
ONGR API Bundle
- Host: GitHub
- URL: https://github.com/ongr-io/apibundle
- Owner: ongr-io
- License: mit
- Created: 2015-03-23T12:24:09.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-04T07:54:22.000Z (over 8 years ago)
- Last Synced: 2024-10-29T18:47:21.428Z (about 2 months ago)
- Language: PHP
- Size: 372 KB
- Stars: 8
- Watchers: 19
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ONGR Api Bundle
Api Bundle allows rapid setup of RESTful API to simplify Elasticsearch data access for the remote clients.
[![Build Status](https://travis-ci.org/ongr-io/ApiBundle.svg?branch=master)](https://travis-ci.org/ongr-io/ApiBundle)
Documentation
The source of the documentation is stored in the `Resources/doc/` folder in this bundle.
[Read the API Bundle Documentation][2]
## Setup the bundle
> This example assumes that you already have configured Elasticsearch bundle.
If you haven't, here's a quick [setup guide][3] on how to do it.### Step 1: Install
Api bundle is installed using [Composer][4].
```bash
composer require ongr/api-bundle "~1.0"
```### Step 2: Enable bundle in the AppKernel
```php
API Bundle requires JMS Serializer to work with JSON and XML### Step 3: Add configuration
Add minimal configuration for Api bundle to the `config.yml`.
```yaml
#app/config/config.ymlongr_api:
default_encoding: json
versions:
v3:
endpoints:
product:
repository: es.manager.default.product
```> The example above shows a minimal configuration. To learn more take a look at the [configuration page][5].
Add routing
```yaml
#app/config/routing.ymlongr_api_routing:
resource: @ONGRApiBundle/Resources/config/routing.yml
prefix: /api
```> You can specify prefix like you want, `api` is only the example.
### Step 4: That's it
Its ready to use. API Bundle will generate new url endpoints by your configuration, by previous configuration you will have: `/api/v3/product`
### What's next ?
Head to [configuration page][5] to learn how to get most of your API or take a look at the [basic usage example][6]
## License
This bundle is covered by the MIT license. Please see the complete license in the bundle [LICENSE][1] file.
[1]: LICENSE
[2]: Resources/doc/index.md
[3]: https://github.com/ongr-io/ElasticsearchBundle/blob/master/README.md
[4]: https://getcomposer.org/doc/00-intro.md
[5]: Resources/doc/configuration.md
[6]: Resources/doc/usage.md