File size: 536 Bytes
5208096
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from fastapi import FastAPI

from app.api import ecg
from app.db.session import close_engine, init_db

app = FastAPI(title="Sundew Health API", version="0.1.0")


@app.on_event("startup")
def on_startup() -> None:
    init_db()


@app.on_event("shutdown")
def on_shutdown() -> None:
    close_engine()


@app.get("/health", tags=["meta"])
async def health_check() -> dict:
    """
    Simple health endpoint to verify the API is running.
    """
    return {"status": "ok"}


app.include_router(ecg.router, prefix="/ecg", tags=["ecg"])