Task 001: dockerized monorepo foundation
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from src.infrastructure.dependencies import check_dependencies
|
||||
|
||||
|
||||
app = FastAPI(title="AI Content Pipeline Backend")
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
def health() -> dict[str, str]:
|
||||
return {"service": "backend", "status": "ok"}
|
||||
|
||||
|
||||
@app.get("/health/dependencies")
|
||||
def dependency_health() -> JSONResponse:
|
||||
dependencies = check_dependencies()
|
||||
is_ok = all(status == "ok" for status in dependencies.values())
|
||||
|
||||
return JSONResponse(
|
||||
status_code=200 if is_ok else 503,
|
||||
content={
|
||||
"service": "backend",
|
||||
"status": "ok" if is_ok else "error",
|
||||
"dependencies": dependencies,
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user