added child endpoint, ability to add and edit child as well as auto redirect to add-child page when user without child accesses home page
Build and Push Docker Image / build-and-push (pull_request) Successful in 1m5s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 17s

This commit is contained in:
Brian Bjarke Jensen
2025-11-09 11:54:28 +01:00
parent 1950b600cf
commit 16e7153f5f
10 changed files with 656 additions and 2 deletions
+8
View File
@@ -12,6 +12,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.child import router as child_router
from baby_monitor.routers.health import router as health_router
from baby_monitor.repositories.dependencies.get_database import init_db
@@ -47,6 +48,7 @@ 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(child_router)
app.include_router(health_router)
@@ -75,6 +77,12 @@ def serve_admin() -> FileResponse:
return FileResponse(static_path / "admin.html")
@app.get("/add-child.html", include_in_schema=False)
def serve_add_child() -> FileResponse:
"""Serve the add child page."""
return FileResponse(static_path / "add-child.html")
@app.get("/api/")
def read_root(token: Annotated[str, Depends(verify_token)]) -> dict:
"""API root endpoint (requires authentication)."""