Simple Route

This commit is contained in:
2024-07-19 15:47:19 +02:00
parent 156d277e77
commit ab1df63788
156 changed files with 13136 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
$method = $_SERVER['REQUEST_METHOD'];
switch ($method) {
case "GET":
return get();
default:
return Response::api("$method not supported", 500);
}
function get()
{
$db = Database::getInstance();
$query =
"SELECT
*
FROM
egb_gaestebuch";
$stmt = $db->prepare($query);
$stmt->execute();
Response::api($stmt->fetchAll());
}