Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
revert if-else for fastAPI app creation
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon committed Feb 5, 2024
1 parent bef3d55 commit bd2791a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/argilla_server/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ async def redirect_api():
]:
app_configure(app)

_app = FastAPI(docs_url=None, redoc_url=None, openapi_url=None)
_app.mount(settings.base_url, app)

return _app
# This if-else clause is needed to simplify the test dependencies setup. Otherwise we cannot override dependencies
# easily. We can review this once we have separate fastapi application for the api and the webapp.
if settings.base_url and settings.base_url != "/":
_app = FastAPI(docs_url=None, redoc_url=None, openapi_url=None)
_app.mount(settings.base_url, app)
return _app
else:
return app


def configure_middleware(app: FastAPI):
Expand Down

0 comments on commit bd2791a

Please sign in to comment.