From efe2127afba50c8ed9150479340e50c918b26e57 Mon Sep 17 00:00:00 2001 From: jaknapper Date: Thu, 15 May 2025 18:02:43 +0100 Subject: [PATCH] Mount scans to app on startup --- .../server/serve_static_files.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/openflexure_microscope_server/server/serve_static_files.py b/src/openflexure_microscope_server/server/serve_static_files.py index d87e5dec..4f5ad96c 100644 --- a/src/openflexure_microscope_server/server/serve_static_files.py +++ b/src/openflexure_microscope_server/server/serve_static_files.py @@ -44,3 +44,10 @@ def add_static_files(app: FastAPI) -> None: StaticFiles(directory=fpath), name=f"static_{fname}", ) + + # Mount the scan directory to .../scans/, to allow dzi viewing + app.mount( + "/scans/", + StaticFiles(directory="/var/openflexure/scans/"), + name="scans", + )