From abe59c3cb7088bcd8b355c5a22e67346cb244597 Mon Sep 17 00:00:00 2001 From: Pier-Jean Malandrino Date: Fri, 3 Apr 2026 12:14:15 +0200 Subject: [PATCH] Fix health endpoint not reachable through nginx proxy Move /health to /api/health on backend and update the frontend feature flag store to match. Without this, the combined Docker image nginx proxy could not reach the endpoint and feature flags (chunking/prepare mode) failed to load. --- document-parser/main.py | 2 +- document-parser/tests/test_api_endpoints.py | 2 +- frontend/src/features/feature-flags/store.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/document-parser/main.py b/document-parser/main.py index aaf0275..5927c46 100644 --- a/document-parser/main.py +++ b/document-parser/main.py @@ -103,7 +103,7 @@ app.include_router(documents_router) app.include_router(analyses_router) -@app.get("/health") +@app.get("/api/health") def health(): """Health check endpoint.""" return { diff --git a/document-parser/tests/test_api_endpoints.py b/document-parser/tests/test_api_endpoints.py index 2f34518..9826e5c 100644 --- a/document-parser/tests/test_api_endpoints.py +++ b/document-parser/tests/test_api_endpoints.py @@ -26,7 +26,7 @@ def mock_analysis_service(client): class TestHealthEndpoint: def test_health(self, client): - resp = client.get("/health") + resp = client.get("/api/health") assert resp.status_code == 200 data = resp.json() assert data["status"] == "ok" diff --git a/frontend/src/features/feature-flags/store.ts b/frontend/src/features/feature-flags/store.ts index 568609d..b3b3721 100644 --- a/frontend/src/features/feature-flags/store.ts +++ b/frontend/src/features/feature-flags/store.ts @@ -44,7 +44,7 @@ export const useFeatureFlagStore = defineStore('feature-flags', () => { async function load(): Promise { try { - const data = await apiFetch('/health') + const data = await apiFetch('/api/health') engine.value = data.engine loaded.value = true error.value = null