20 lines
463 B
PHP
20 lines
463 B
PHP
<?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";
|
|
}
|