diff --git a/index.php b/index.php index f02e17a..e89a52e 100644 --- a/index.php +++ b/index.php @@ -18,8 +18,10 @@ if (!isLoggedIn()) { setDefaultSessionData(); } +print_r($routerRequest); + if ($routerRequest["type"] == "api") { - echo getEndpoint($routerRequest["page_name"]); + echo getEndpoint($routerRequest["site_name"]); } elseif ($routerRequest["type"] == "page") { echo getPage($routerRequest["site_name"], $routerRequest["page_name"]); diff --git a/lib/router.php b/lib/router.php index 726f28b..0b704be 100644 --- a/lib/router.php +++ b/lib/router.php @@ -10,10 +10,7 @@ function initRouter(): array $request_uri = explode("/", $_SERVER["QUERY_STRING"]); - echo $_SERVER["QUERY_STRING"]; - print_r($request_uri); $request_uri = array_slice($request_uri, -3, 3); - print_r($request_uri); $routerRequest["site_name"] = basename($request_uri[1]); $routerRequest["page_name"] = basename($request_uri[2]);