A skeleton for creating API applications with CakePHP 3.x.
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.
- Includes login and logout endpoints to be used for authentication purposes.
- Includes CRUD endpoints for Users based on the REST guidelines.
- Authorization token is generated within the app to be used in the header's requests.
- It is a basic application. Feel free to add or improve features.
- Download Composer or update
composer self-update
. - Run
php composer.phar create-project --prefer-dist cakephp/app [app_name]
.
If Composer is installed globally, run
composer create-project --prefer-dist cakephp/app
In case you want to use a custom app dir name (e.g. /myapp/
):
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:
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/{id}