Re-arranged call of static/

This commit is contained in:
2025-11-18 00:44:01 +01:00
parent 2392d21e17
commit 08526cfa60

View File

@@ -62,9 +62,6 @@ app = FastAPI(lifespan=lifespan)
# Configure Jinja2 templates # Configure Jinja2 templates
templates = Jinja2Templates(directory=TEMPLATES_DIR) templates = Jinja2Templates(directory=TEMPLATES_DIR)
# Mount the 'static' directory using an absolute path for reliability
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
# Add the authentication router # Add the authentication router
app.include_router(auth.router) app.include_router(auth.router)
@@ -72,6 +69,9 @@ app.include_router(auth.router)
# We can reuse our encryption key for this, but in production you might want a separate key. # We can reuse our encryption key for this, but in production you might want a separate key.
app.add_middleware(SessionMiddleware, secret_key=settings.ENCRYPTION_KEY) app.add_middleware(SessionMiddleware, secret_key=settings.ENCRYPTION_KEY)
# Mount the 'static' directory using an absolute path for reliability
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
@app.get("/") @app.get("/")
async def read_root(request: Request): async def read_root(request: Request):
return templates.TemplateResponse("login.html", {"request": request}) return templates.TemplateResponse("login.html", {"request": request})