All Projects β†’ tuupola β†’ Slim Api Skeleton

tuupola / Slim Api Skeleton

Licence: mit
Slim 3 API skeleton project for Composer

Projects that are alternatives of or similar to Slim Api Skeleton

Koa Rest Api Boilerplate
πŸ’― Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
Stars: ✭ 420 (+41.89%)
Mutual labels:  api, rest, skeleton
Flaresolverr
Proxy server to bypass Cloudflare protection
Stars: ✭ 241 (-18.58%)
Mutual labels:  api, rest
Jiraps
PowerShell module to interact with Atlassian JIRA
Stars: ✭ 241 (-18.58%)
Mutual labels:  api, rest
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (-14.53%)
Mutual labels:  api, rest
Horaires Ratp Api
Webservice pour les horaires et trafic RATP en temps rΓ©el
Stars: ✭ 232 (-21.62%)
Mutual labels:  api, rest
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+1064.86%)
Mutual labels:  api, rest
React Fetches
πŸ™React Fetches a new way to make requests into your REST API's.
Stars: ✭ 253 (-14.53%)
Mutual labels:  api, rest
Bookmarks.dev
Bookmarks and Code Snippets Manager for Developers & Co
Stars: ✭ 218 (-26.35%)
Mutual labels:  api, rest
Django Oscar Api
RESTful JSON API for django-oscar
Stars: ✭ 251 (-15.2%)
Mutual labels:  api, rest
Azure Devops Python Api
Azure DevOps Python API
Stars: ✭ 257 (-13.18%)
Mutual labels:  api, rest
Requester
Powerful, modern HTTP/REST client built on top of the Requests library
Stars: ✭ 273 (-7.77%)
Mutual labels:  api, rest
Flask Restplus
Fully featured framework for fast, easy and documented API development with Flask
Stars: ✭ 2,585 (+773.31%)
Mutual labels:  api, rest
Guzzle Services
Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.
Stars: ✭ 226 (-23.65%)
Mutual labels:  api, rest
Wp Rest Api Cache
Enable caching for WordPress REST API and increase speed of your application
Stars: ✭ 239 (-19.26%)
Mutual labels:  api, rest
Ccxt Rest
Open Source Unified REST API of 100+ Crypto Exchange Sites (18k+ docker pulls) - https://ccxt-rest.io/
Stars: ✭ 210 (-29.05%)
Mutual labels:  api, rest
Go Grpc Http Rest Microservice Tutorial
Source code for tutorial "How to develop Go gRPC microservice with HTTP/REST endpoint, middleware, Kubernetes deployment, etc."
Stars: ✭ 250 (-15.54%)
Mutual labels:  api, rest
Nodejs Restful Api
How to create a RESTful CRUD API using Nodejs?
Stars: ✭ 285 (-3.72%)
Mutual labels:  api, rest
Symfony Flex Backend
Symfony Flex REST API template project
Stars: ✭ 214 (-27.7%)
Mutual labels:  api, rest
Ray
a framework that helps you to deliver well-designed python APIs
Stars: ✭ 215 (-27.36%)
Mutual labels:  api, rest
Httpie
As easy as /aitch-tee-tee-pie/ πŸ₯§ Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+17822.97%)
Mutual labels:  api, rest

Slim 3 API skeleton

Software License Build Status Coverage

This is Slim 3 API skeleton project for Composer. Project uses Zend Table Gateway and Phinx for database operations, Monolog for logging, and Fractal as a serializer. Vagrant virtualmachine config and Paw project files are included for easy development. The skeleton tries to follow DDD principles.

Install

Install the latest version using composer.

$ composer create-project --no-interaction --stability=dev tuupola/slim-api-skeleton app

Usage

If you have Vagrant installed start the virtual machine.

$ cd app
$ vagrant up

Now you can access the api at https://192.168.50.52/todos

Get a token

$ curl "https://192.168.50.52/token" \
    --request POST \
    --include \
    --insecure \
    --header "Content-Type: application/json" \
    --data '["todo.all"]' \
    --user test:test

HTTP/1.1 201 Created
Content-Type: application/json

{
    "token": "XXXXXXXXXX",
    "expires": 1491030210
}
$ export TOKEN=XXXXXXXXXX

Create a new todo

$ curl "https://192.168.50.52/todos" \
    --request POST \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN" \
    --header "Content-Type: application/json" \
    --data '{ "title": "Test the API", "order": 10 }'

HTTP/1.1 201 Created
ETag: "c39de417d4d1f5fe22d19cad68d672d8"
Last-Modified: Sat, 16 Apr 2016 10:21:50 GMT
Location: /todos/12Cf2ZjVvyu3A
Content-Type: application/json

{
    "data": {
        "uid": "12Cf2ZjVvyu3A",
        "order": 10,
        "title": "Test the API",
        "completed": false,
        "links": {
            "self": "/todos/12Cf2ZjVvyu3A"
        }
    }
}

Get an existing todo

$ curl "https://192.168.50.52/todos/12Cf2ZjVvyu3A" \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN"

HTTP/1.1 200 OK
ETag: "c39de417d4d1f5fe22d19cad68d672d8"
Last-Modified: Sat, 16 Apr 2016 10:21:50 GMT
Content-Type: application/json

{
    "data": {
        "uid": "12Cf2ZjVvyu3A",
        "order": 10,
        "title": "Test the API",
        "completed": false,
        "links": {
            "self": "/todos/12Cf2ZjVvyu3A"
        }
    }
}

Update part of an existing todo

$ curl "https://192.168.50.52/todos/12Cf2ZjVvyu3A" \
    --request PATCH \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN" \
    --header "Content-Type: application/json" \
    --header 'If-Match: "c39de417d4d1f5fe22d19cad68d672d8"' \
    --data '{ "order": 27 }'

HTTP/1.1 200 OK
ETag: "ab6070930158fc8323aa4550aff438b7"
Last-Modified: Sat, 16 Apr 2016 10:27:16 GMT
Content-Type: application/json

{
    "data": {
        "uid": "12Cf2ZjVvyu3A",
        "order": 27,
        "title": "Test the API",
        "completed": false,
        "links": {
            "self": "/todos/12Cf2ZjVvyu3A"
        }
    }
}

Fully update an existing todo

$ curl "https://192.168.50.52/todos/12Cf2ZjVvyu3A" \
    --request PUT \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN" \
    --header "Content-Type: application/json" \
    --header 'If-Match: "ab6070930158fc8323aa4550aff438b7"' \
    --data '{ "title": "Full update", "order": 66, "completed": true }'

HTTP/1.1 200 OK
ETag: "451665ea7769851880f411750bbd873c"
Last-Modified: Sat, 16 Apr 2016 10:28:45 GMT
Content-Type: application/json

{
    "data": {
        "uid": "12Cf2ZjVvyu3A",
        "order": 66,
        "title": "Full update",
        "completed": true,
        "links": {
            "self": "/todos/12Cf2ZjVvyu3A"
        }
    }
}

Delete an existing todo

$ curl "https://192.168.50.52/todos/12Cf2ZjVvyu3A" \
    --request DELETE \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN"

HTTP/1.1 204 No Content

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].