diff --git a/cli/medperf/web_ui/app.py b/cli/medperf/web_ui/app.py index de8249890..3c8cca87d 100644 --- a/cli/medperf/web_ui/app.py +++ b/cli/medperf/web_ui/app.py @@ -1,4 +1,5 @@ from importlib import resources +from pathlib import Path import typer from fastapi import FastAPI @@ -20,15 +21,17 @@ web_app.include_router(mlcubes_router, prefix="/mlcubes") web_app.include_router(yaml_fetch_router) +static_folder_path = Path(resources.files("medperf.web_ui")) / "static" # noqa web_app.mount( "/static", StaticFiles( - directory=str(resources.path("medperf.web_ui", "static")), + directory=static_folder_path, ) ) web_app.add_exception_handler(Exception, custom_exception_handler) + @web_app.get("/", include_in_schema=False) def read_root(): return RedirectResponse(url="/benchmarks/ui")