sadick / resty
A simple php router
v0.12.0
2018-12-11 13:47 UTC
Requires (Dev)
- phpunit/phpunit: ^7.1
README
Resty
A fast, minimal with zero dependancies php router that enables you write straight forward rest api's
Installation
Use Composer to install Resty
composer require sadick/resty
Usage
<?php require 'vendor/autoload.php' use Resty\Router; $app = new Router(); $app->get('/users', function ($req, $res) { $res->send("hello world"); }); $app->serve();
You can test that your requests are being served using the built in php server
php -S localhost:4000
Navigating to http://localhost:4000/users will display hello world