24 lines
512 B
Python
24 lines
512 B
Python
from contextlib import asynccontextmanager
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from app.db import run_migrations
|
|
from app.routers.projects import router as projects_router
|
|
from app.routers.work import router as work_router
|
|
|
|
|
|
@asynccontextmanager
|
|
async def lifespan(_: FastAPI):
|
|
run_migrations()
|
|
yield
|
|
|
|
|
|
app = FastAPI(title="Work Queue API", lifespan=lifespan)
|
|
app.include_router(projects_router)
|
|
app.include_router(work_router)
|
|
|
|
|
|
@app.get("/health")
|
|
def health() -> dict[str, str]:
|
|
return {"status": "ok"}
|