diff --git a/fileglancer/app.py b/fileglancer/app.py index 97f9a30f8..f98694552 100644 --- a/fileglancer/app.py +++ b/fileglancer/app.py @@ -268,6 +268,15 @@ def mask_password(url: str) -> str: app = FastAPI(lifespan=lifespan) + try: + from omero_figure.fileglancer import app as figure_app + app.include_router(figure_app.router, prefix="/omero-figure", tags=["figure"]) + static_dir = figure_app.get_static_dir() + # NB: vite must build the figure app with "base: '/omero-figure/'" for this to work correctly + app.mount("/omero-figure/", StaticFiles(directory=static_dir, html=True), name="omero_figure") + except Exception: + logger.info("Could not import figure app. Figure-related endpoints will not be available.") + # Add custom access log middleware # This logs HTTP access information with authenticated username app.add_middleware(AccessLogMiddleware, settings=settings)