Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.yml

ongr_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.yml

ongr_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