Files
appfactory-portal/app/routes/catalog.py
T
2026-06-15 11:00:09 +02:00

27 lines
780 B
Python

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}