From cce7712bb0477f1b075f3fe5af336722817ea6af Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Mon, 10 Feb 2025 17:56:42 +0100 Subject: [PATCH] fix: fixed path to api docs --- backend/bec_atlas/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/bec_atlas/main.py b/backend/bec_atlas/main.py index 2823ce7..b92a7e5 100644 --- a/backend/bec_atlas/main.py +++ b/backend/bec_atlas/main.py @@ -25,8 +25,14 @@ class AtlasApp: API_VERSION = "v1" def __init__(self, config=None): + self.prefix = f"/api/{self.API_VERSION}" self.config = config or CONFIG - self.app = FastAPI() + self.app = FastAPI( + docs_url=f"{self.prefix}/docs", + openapi_url=f"{self.prefix}/openapi.json", + redoc_url=f"{self.prefix}/redoc", + title="BEC Atlas API", + ) self.app.add_middleware( CORSMiddleware, allow_origins=origins, @@ -35,7 +41,6 @@ class AtlasApp: allow_headers=["*"], ) self.server = None - self.prefix = f"/api/{self.API_VERSION}" self.datasources = DatasourceManager(config=self.config) self.datasources.connect() self.register_event_handler()