Spaces:
Runtime error
Runtime error
| """ | |
| SOS Care Now — Medical Scheduling Agent (HTML / FastAPI version). | |
| Single-page modern dashboard served from FastAPI. | |
| Run locally: uvicorn main:app --host 0.0.0.0 --port 7860 --reload | |
| In Docker: CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |
| """ | |
| from pathlib import Path | |
| from fastapi import FastAPI, Request | |
| from fastapi.responses import FileResponse, JSONResponse | |
| from fastapi.staticfiles import StaticFiles | |
| from fastapi.exceptions import HTTPException | |
| from api import auth as auth_routes | |
| from api import providers as providers_routes | |
| from api import patients as patients_routes | |
| from api import appointments as appointments_routes | |
| from api import schedule as schedule_routes | |
| from api import calendar as calendar_routes | |
| from api import audit as audit_routes | |
| from api import settings as settings_routes | |
| BASE_DIR = Path(__file__).resolve().parent | |
| app = FastAPI(title="SOS Care Now — Scheduling") | |
| async def http_exception_handler(request: Request, exc: HTTPException): | |
| return JSONResponse(status_code=exc.status_code, content={"detail": exc.detail}) | |
| # API routers | |
| app.include_router(auth_routes.router) | |
| app.include_router(providers_routes.router) | |
| app.include_router(patients_routes.router) | |
| app.include_router(appointments_routes.router) | |
| app.include_router(schedule_routes.router) | |
| app.include_router(calendar_routes.router) | |
| app.include_router(audit_routes.router) | |
| app.include_router(settings_routes.router) | |
| # Static assets | |
| app.mount("/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static") | |
| def root(): | |
| return FileResponse(str(BASE_DIR / "templates" / "index.html")) | |
| def healthz(): | |
| return {"ok": True} | |