项目作者: gusmt66

项目描述 :
A skeleton for creating API applications.
高级语言: PHP
项目地址: git://github.com/gusmt66/skeleton-api.git
创建时间: 2017-06-21T20:40:27Z
项目社区:https://github.com/gusmt66/skeleton-api

开源协议:

下载


Skeleton for an API Application

Build Status
License

A skeleton for creating API applications with CakePHP 3.x.

Description

This Application is a starting point for creating an API to be consumed from other apps. It includes a basic MySQL script for the User’s table.

Features

  1. Includes login and logout endpoints to be used for authentication purposes.
  2. Includes CRUD endpoints for Users based on the REST guidelines.
  3. Authorization token is generated within the app to be used in the header’s requests.
  4. It is a basic application. Feel free to add or improve features.

Installation

  1. Download Composer or update composer self-update.
  2. Run php composer.phar create-project --prefer-dist cakephp/app [app_name].

If Composer is installed globally, run

  1. composer create-project --prefer-dist cakephp/app

In case you want to use a custom app dir name (e.g. /myapp/):

  1. composer create-project --prefer-dist cakephp/app myapp

You can now either use your machine’s webserver to view the default home page, or start
up the built-in webserver with:

  1. bin/cake server -p 8765

Then you can start using the API calling these endpoints:

POST http://localhost:8765/api/users/login

POST http://localhost:8765/api/users

GET http://localhost:8765/api/users?ci_number=14&last_name=mo&first_name=u&sortField=last_name&sortDirection=desc&limit=2

GET http://localhost:8765/api/users/{id}

PUT http://localhost:8765/api/users/{id}

DELETE http://localhost:8765/api/users/{id}