This commit is contained in:
2024-07-19 13:05:21 +02:00
parent 88f535a1ed
commit 156d277e77
10 changed files with 229 additions and 71 deletions
+5 -3
View File
@@ -3,9 +3,11 @@
$path = ltrim(str_replace(Config::getBasePath(), "", $_SERVER['REQUEST_URI']), "/");
try {
if (substr($path, 0, 3) === "api") {
if (strpos($path, "docs") === false) {
require_once __DIR__ . "/../$path/index.php";
$segments = PathParams::get();
if ($segments[0] === "api") {
if ($segments[1] !== "docs") {
require_once __DIR__ . "/../api/{$segments[1]}/index.php";
} else {
Headers::redirect("index.html");
}