phramework / jsonapi-example

Example API using phramework/jsonapi
Apache License 2.0
1 stars 2 forks source link

Simple API example using phramework/jsonapi 1.x

Build Status

Endpoints

Available endpoints:

/administrator/ API

Install

Requirements:

To download dependencies

composer update

It is also recommended to install and configure Xdebug

Run

To initialize the SQLite database schema and records (required to run only once). You can reuse the command to reset the data.

php ./tools/database.php

To start local web server at port 8004 execute using php build-in server

php -S localhost:8004 -t ./public/

You can access the article collection using GET http://localhost:8004/article/ request.

You can also expose /public to your web server, NOTE we are using an .htaccess file to rewrite the urls.

Test

To run all available tests (syntax check, unit and request tests)

composer test

Testphase

To execute only testphase tests

composer testphase

To generate an overview for testphase tests execute

composer testphase-report

More about writing testphase tests at https://github.com/phramework/testphase

Lint code

Lint code using PSR-2 coding style

composer lint

Local settings

Read localsettings.example.php if you need to modify any of the settings localy, without committing the changes.