From 37098f45185050812f16300dcbf2a57512b9d3a0 Mon Sep 17 00:00:00 2001 From: mwpn Date: Wed, 17 Dec 2025 14:18:21 +0700 Subject: [PATCH] fix: Add global OPTIONS route for CORS preflight handling --- public/index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/index.php b/public/index.php index 3d8ea9d..59586c2 100644 --- a/public/index.php +++ b/public/index.php @@ -19,6 +19,11 @@ AppConfig::loadEnv(__DIR__ . '/..'); // Bootstrap application $app = AppBootstrap::create(); +// Global OPTIONS route for CORS preflight (must be before other routes) +$app->options('/{routes:.+}', function ($request, $response) { + return $response->withStatus(204); +}); + // Root route - redirect to docs $app->get('/', function ($request, $response) { return $response