12 lines
333 B
Python
12 lines
333 B
Python
from fastapi import APIRouter, Query
|
|
|
|
from ..diagnostics import run_diagnostics
|
|
|
|
router = APIRouter(prefix="/api/diagnostics", tags=["diagnostics"])
|
|
|
|
|
|
@router.get("")
|
|
def get_diagnostics(campaign_id: str = Query("default")):
|
|
checks = run_diagnostics(campaign_id)
|
|
return {"ok": all(c["ok"] for c in checks), "checks": checks}
|