<commit_before>#slim-jsonAPI
This is an extension to the [SLIM framework](https://github.com/codeguy/Slim) to implement json API's with great ease.

##instalation
Using composer you can add use this as your composer.json

```json
    {
        "require": {
            "slim/slim": "2.*",
            "entomb/slim-json-api": "dev-master"
        }
    }

```

##Usage
To include the middleware and view you just have to load them using the default _Slim_ way.

```php
    require 'vendor/autoload.php';

    $app = new \Slim\Slim();

    $app->view(new \JsonView());
    $app->add(new \JsonApiMiddleware());
```

after this, all your requests will be returning json output.

the usage will be `$app->render(HTTP_CODE, array DATA);`

```php

    $app->get('/', function() use ($app) {
        $app->render(200,array(
                'msg' => 'welcome to my API!',
            ));
    });

```
```json
{
    "msg":"welcome to my API!",
    "error":false,
    "status":200
}<commit_msg>small typo<commit_after>#slim-jsonAPI
This is an extension to the [SLIM framework](https://github.com/codeguy/Slim) to implement json API's with great ease.

##instalation
Using composer you can add use this as your composer.json

```json
    {
        "require": {
            "slim/slim": "2.*",
            "entomb/slim-json-api": "dev-master"
        }
    }

```

##Usage
To include the middleware and view you just have to load them using the default _Slim_ way.

```php
    require 'vendor/autoload.php';

    $app = new \Slim\Slim();

    $app->view(new \JsonApiView());
    $app->add(new \JsonApiMiddleware());
```

after this, all your requests will be returning json output.

the usage will be `$app->render(HTTP_CODE, array DATA);`

```php

    $app->get('/', function() use ($app) {
        $app->render(200,array(
                'msg' => 'welcome to my API!',
            ));
    });

```
```json
{
    "msg":"welcome to my API!",
    "error":false,
    "status":200
}
{'fraction_non_alphanumeric': 0.16276703967446593, 'fraction_numerical': 0.007121057985757884, 'mean_word_length': 2.6425925925925924, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4164871', 'n_tokens_mistral': 680, 'n_tokens_neox': 646, 'n_words': 193}