Skip to content

Commit

Permalink
Edit readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Kelemen committed Jul 5, 2016
1 parent 3ceb616 commit 30603a3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,8 @@
# Change log

### [Unreleased][unreleased]

### 0.1.0 - 2016-07-05
- First tagged version

[unreleased]: https://github.com/ricco24/api-nette/compare/0.1.0...HEAD
21 changes: 21 additions & 0 deletions LICENSE.md
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 lulco

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 8 additions & 3 deletions README.md
Expand Up @@ -5,17 +5,22 @@ Highly customizable and easy to setup REST api handling for Nette framework.
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ricco24/api-nette/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ricco24/api-nette/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/ricco24/api-nette/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ricco24/api-nette/?branch=master)
[![Build Status](https://travis-ci.org/ricco24/api-nette.svg?branch=master)](https://travis-ci.org/ricco24/api-nette)
[![Packagist](https://img.shields.io/packagist/v/kelemen/api-nette.svg?maxAge=14400)](https://packagist.org/packages/kelemen/api-nette)

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/3f401779-98cc-4191-8339-8fa211c917f5/big.png)](https://insight.sensiolabs.com/projects/3f401779-98cc-4191-8339-8fa211c917f5)

## Installation

```
composer require kelemen/api-nette
```

## Prepare to use

1. First of all you need an Api presenter for handle api requests. You can use `Kelemen\ApiNette\Presenter\ApiPresenter` or write you own.
2. Register new mapping in config.neon

```
```php
application:
mapping:
Api: Kelemen\ApiNette\Presenter\*Presenter
Expand All @@ -32,7 +37,7 @@ Highly customizable and easy to setup REST api handling for Nette framework.

4. Configure Api (example from config.neon)

```
```php
services:
api:
class: Kelemen\ApiNette\Api
Expand All @@ -55,7 +60,7 @@ REST api routes can be defined with shortcut functions (for most used HTTP metho
- delete
- options

But you can add any HTTP method processing by `add($method, $pattern, $handler, $params = [])` function.
Or you can add any HTTP method processing with `add($method, $pattern, $handler, $params = [])` function.
```php
$api = new Api(...);
$api->add('purge', 'purge/urls', 'Handlers\PurgeHandler')
Expand Down

0 comments on commit 30603a3

Please sign in to comment.