An open API service indexing awesome lists of open source software.

https://github.com/cutplane1/u-router


https://github.com/cutplane1/u-router

php-library php-router php-routing router zero-dependency

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# u-router

```php
not_found(function() {
http_response_code(404);
echo "

404 Not Found

";
});

$router->middleware(function() {
header('Content-Type: application/json; charset=utf-8');
});

$router->get("/", function() {
echo json_encode(["hello" => "world"]);
});

$router->get("/", function($id) {
echo json_encode(["id" => $id]);
});

$router->dispatch();
```