Simple Route

This commit is contained in:
2024-07-19 15:47:19 +02:00
parent 156d277e77
commit ab1df63788
156 changed files with 13136 additions and 0 deletions
-19
View File
@@ -1,19 +0,0 @@
<?php
$path = ltrim(str_replace(Config::getBasePath(), "", $_SERVER['REQUEST_URI']), "/");
try {
$segments = PathParams::get();
if ($segments[0] === "api") {
if ($segments[1] !== "docs") {
require_once __DIR__ . "/../api/{$segments[1]}/index.php";
} else {
Headers::redirect("index.html");
}
} else {
require_once __DIR__ . "/../pages/index.html";
}
} catch (Exception $e) {
require_once __DIR__ . "/../pages/500.php";
}