This commit is contained in:
Ashley Rose
2026-02-23 10:45:57 -06:00
commit 7152f830c0
23 changed files with 636 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
$uri = parse_url($_SERVER['REQUEST_URI'])['path'];
$routes = [
'/' => 'routes/index.php',
'/ember' => 'routes/ember.php',
];
function routeToController($uri, $routes)
{
if (array_key_exists($uri, $routes)) {
require $routes[$uri];
} else {
abort();
}
}
function abort($code = 404)
{
http_response_code($code);
require "routes/404.php";
die(0);
}
routeToController($uri, $routes);