From bab8fc33ccb7e67103cb10bd628f9335e72f8c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Wed, 20 May 2026 13:27:54 +0300 Subject: [PATCH] fix: mount /static/downloads before /static to avoid prefix conflict Co-Authored-By: Claude Opus 4.6 --- server/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/main.py b/server/main.py index 2125d22..2c7171d 100644 --- a/server/main.py +++ b/server/main.py @@ -60,14 +60,15 @@ app = FastAPI(title="VPS Monitoring", lifespan=lifespan) # Static files BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -app.mount("/static", StaticFiles(directory=os.path.join(BASE_DIR, "static")), name="static") templates = Jinja2Templates(directory=os.path.join(BASE_DIR, "templates")) -# Static downloads (Windows agent) +# Static downloads (Windows agent) — mount BEFORE /static to avoid prefix conflict DOWNLOADS_DIR = os.path.join(os.path.dirname(BASE_DIR), "windows") if os.path.isdir(DOWNLOADS_DIR): app.mount("/static/downloads", StaticFiles(directory=DOWNLOADS_DIR), name="downloads") +app.mount("/static", StaticFiles(directory=os.path.join(BASE_DIR, "static")), name="static") + # Include routers app.include_router(servers_router) app.include_router(auth_router)