From e8a9deb7adf56d0b9ba8d5af97af6a610c1bf297 Mon Sep 17 00:00:00 2001 From: gilles Date: Mon, 14 Sep 2026 14:41:58 +0200 Subject: [PATCH] feat: front controller, routage et gestion d'erreurs --- public/.htaccess | 4 ++++ public/index.php | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 public/.htaccess create mode 100644 public/index.php diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..11b28de --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,4 @@ +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^ index.php [QSA,L] \ No newline at end of file diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..51d20f2 --- /dev/null +++ b/public/index.php @@ -0,0 +1,33 @@ +handle($_SERVER['REQUEST_METHOD'], $path); +} catch (Throwable $e) { + http_response_code(500); + echo json_encode(['error' => 'Erreur interne du serveur.'], JSON_UNESCAPED_UNICODE); +} \ No newline at end of file