added burger menu with admin page and user invitation link generation
This commit is contained in:
@@ -11,6 +11,7 @@ from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from baby_monitor.routers.auth import router as auth_router
|
||||
from baby_monitor.routers.auth import verify_token
|
||||
from baby_monitor.routers.admin import router as admin_router
|
||||
from baby_monitor.routers.health import router as health_router
|
||||
from baby_monitor.repositories.dependencies.get_database import init_db
|
||||
|
||||
@@ -45,15 +46,35 @@ app.mount("/static", StaticFiles(directory=str(static_path)), name="static")
|
||||
|
||||
# Include routers
|
||||
app.include_router(auth_router)
|
||||
app.include_router(admin_router)
|
||||
app.include_router(health_router)
|
||||
|
||||
|
||||
# Serve HTML pages at root level
|
||||
@app.get("/", include_in_schema=False)
|
||||
def serve_home() -> FileResponse:
|
||||
"""Serve the home page (handles auth check client-side)."""
|
||||
return FileResponse(static_path / "index.html")
|
||||
|
||||
|
||||
@app.get("/login.html", include_in_schema=False)
|
||||
def serve_login() -> FileResponse:
|
||||
"""Serve the login page."""
|
||||
return FileResponse(static_path / "login.html")
|
||||
|
||||
|
||||
@app.get("/register.html", include_in_schema=False)
|
||||
def serve_register() -> FileResponse:
|
||||
"""Serve the registration page."""
|
||||
return FileResponse(static_path / "register.html")
|
||||
|
||||
|
||||
@app.get("/admin.html", include_in_schema=False)
|
||||
def serve_admin() -> FileResponse:
|
||||
"""Serve the admin page."""
|
||||
return FileResponse(static_path / "admin.html")
|
||||
|
||||
|
||||
@app.get("/api/")
|
||||
def read_root(token: Annotated[str, Depends(verify_token)]) -> dict:
|
||||
"""API root endpoint (requires authentication)."""
|
||||
|
||||
Reference in New Issue
Block a user