Fix API
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user