johnsquibb / rest-api
A lightweight REST API framework
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.0
- johnsquibb/php-microframework: dev-main
Requires (Dev)
This package is not auto-updated.
Last update: 2025-04-28 05:22:13 UTC
README
A minimal PHP 8 REST API built onto php-microframework.
Features
- Automatic routing based on URL path, e.g.
https://domain/controller/method/parameters...
Development Status
The framework is currently in development and subject to frequent change. A stable version with tagged release will be made available when ready.
Installation
composer create-project johnsquibb/rest-api:dev-main
Setup
Point the desired web server at the public directory and modify the contents of index.php to add additional controller search paths.
Run
Use the builtin PHP server to serve from the public directory during development:
php -S localhost:8080 -t public
Then visit: http://localhost:8080/api to view the demo.
The Demo resource at http://localhost:8080/api/demo provides the following operations:
- GET (collection)
- GET (item)
- POST (create item)
- PUT (update item)
- DELETE (item)