2024-02-05 21:21:04 +01:00
|
|
|
<?php
|
2024-04-27 11:48:58 +02:00
|
|
|
declare(strict_types=1);
|
2024-02-05 21:21:04 +01:00
|
|
|
|
|
|
|
require_once "lib/page.php";
|
|
|
|
require_once "lib/navigation.php";
|
|
|
|
|
|
|
|
function endpoint($endpoint_data): array
|
|
|
|
{
|
|
|
|
return match ($endpoint_data["action"]) {
|
|
|
|
"getNavigation" => getNavigationEndpoint(),
|
|
|
|
"getPage" => getPageEndpoint($endpoint_data["page"], $endpoint_data["site"]),
|
|
|
|
default => ["Status" => "Fail", "message" => "Invalid action"],
|
|
|
|
};
|
|
|
|
}
|