mirror of
https://github.com/andrey271192/vps_monitoring.git
synced 2026-09-20 11:55:34 +00:00
fix: mount /static/downloads before /static to avoid prefix conflict
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,14 +60,15 @@ app = FastAPI(title="VPS Monitoring", lifespan=lifespan)
|
|||||||
|
|
||||||
# Static files
|
# Static files
|
||||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
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"))
|
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")
|
DOWNLOADS_DIR = os.path.join(os.path.dirname(BASE_DIR), "windows")
|
||||||
if os.path.isdir(DOWNLOADS_DIR):
|
if os.path.isdir(DOWNLOADS_DIR):
|
||||||
app.mount("/static/downloads", StaticFiles(directory=DOWNLOADS_DIR), name="downloads")
|
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
|
# Include routers
|
||||||
app.include_router(servers_router)
|
app.include_router(servers_router)
|
||||||
app.include_router(auth_router)
|
app.include_router(auth_router)
|
||||||
|
|||||||
Reference in New Issue
Block a user