<?php
require "vendor/autoload.php";
$router = new Cutplane1\URouter();
$router->not_found(function() {
http_response_code(404);
echo "<h1>404 Not Found</h1>";
});
$router->middleware(function() {
header('Content-Type: application/json; charset=utf-8');
});
$router->get("/", function() {
echo json_encode(["hello" => "world"]);
});
$router->get("/<int>", function($id) {
echo json_encode(["id" => $id]);
});
$router->dispatch();
-
Notifications
You must be signed in to change notification settings - Fork 0
License
cutplane1/u-router
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description or website provided.
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published