fix: fixed path to api docs

This commit is contained in:
2025-02-10 17:56:42 +01:00
parent 8219b20bd1
commit cce7712bb0

View File

@ -25,8 +25,14 @@ class AtlasApp:
API_VERSION = "v1" API_VERSION = "v1"
def __init__(self, config=None): def __init__(self, config=None):
self.prefix = f"/api/{self.API_VERSION}"
self.config = config or CONFIG 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( self.app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=origins, allow_origins=origins,
@ -35,7 +41,6 @@ class AtlasApp:
allow_headers=["*"], allow_headers=["*"],
) )
self.server = None self.server = None
self.prefix = f"/api/{self.API_VERSION}"
self.datasources = DatasourceManager(config=self.config) self.datasources = DatasourceManager(config=self.config)
self.datasources.connect() self.datasources.connect()
self.register_event_handler() self.register_event_handler()