Starter pack to create an API with slim 3

Installs: 17

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0


0.3.0 2017-10-06 23:45 UTC

This package is not auto-updated.

Last update: 2020-08-04 07:10:23 UTC


Build Status License

This is a starter Api code for Slim 3.0+. This Api was designed to be a unique starter code when starting a fresh new Api. This project was also built to be easily extensible when we need common endpoint (cf: future endpoint plugins).


Get last version with Composer.

composer require aoculi/slim-api

Create a new Endpoint

You can add new routes for your api on public/index.php

$app = (new App($config))


POST /v1/token with good credentials as Basic Auth

curl --request POST \
  --url \
  --user admin:test

HTTP/1.1 201 Created Content-Type: application/json { "token": "XXXXXXXXXX", "expires": 1491030210 }

Now you can access all other routes with the token

curl --request GET \
  --url \
  --header 'authorization: Bearer {TOKEN}' \

Add a slim-api endpoint extension

You can check the documentation: aoculi/slim-api-users

make endpoint-users

and add the new endpoints in your app

$app = (new App($config))

To do

  • aoculi/slim-api-migration (use phinx)
  • aoculi/slim-api-email (use swiftmailer/swiftmailer?)
  • aoculi/slim-api-validation (use respect/validation)
  • aoculi/slim-api-comments (endpoint comments)
  • aoculi/slim-api-likes (endpoint likes)