fix: switch API routing to query string for Nginx compatibility
This commit is contained in:
@@ -64,11 +64,11 @@ $router->addRoute('GET', '/api/v1/health', function($request) {
|
||||
]);
|
||||
});
|
||||
|
||||
// ══ SPA Shell ═══════════════════════════════════════════════
|
||||
$fullPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
// ══ Determine if this is an API request ═════════════════════════════
|
||||
$apiRoute = $_GET['route'] ?? null;
|
||||
|
||||
// Check if this is an API request (works regardless of subdirectory)
|
||||
if (!str_contains($fullPath, '/api/v1/')) {
|
||||
if (!$apiRoute) {
|
||||
// Not an API call — serve the SPA shell
|
||||
include __DIR__ . '/shell.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user