from fastapi import APIRouter from ..catalog import load_apps router = APIRouter() @router.get("/catalog") def services_catalog(): """Public, unauthenticated JSON catalog of deployed services. Returns each service's name and a link to its documentation. Intended to be exposed publicly (the AppFactory reverse proxy maps the public ``/apps`` onto this endpoint). The data comes from the generated catalog (catalog.yml) and contains no secrets. """ services = [] for item in load_apps(): app_id = item.get("id", "") if not app_id: continue services.append({ "name": item.get("name", app_id), "docs": item.get("docs", f"/apps/{app_id}/docs"), }) return {"services": services}