You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GET / currently returns a JSON navigation object (RootResponse). Following the pattern used by TiTiler and OGC APIs, the root endpoint should serve an HTML landing page by default, with ?f=json (or Accept: application/json) returning the existing JSON response.
Proposed behaviour
Request
Response
GET /
HTML landing page
GET /?f=json
Current JSON (RootResponse)
GET / with Accept: application/json
Current JSON (RootResponse)
Landing page content
The HTML page should be self-contained (no external CDN dependencies) and include:
API name and short description
Current instance status:
Configured extent (id, name, bbox) — from GET /extent
Ingestion summary (dataset count, last sync time) — from GET /datasets
The format negotiation logic can live in system/routes.py on the existing GET / handler: check request.query_params.get("f") and request.headers.get("accept"), return HTMLResponse or JSONResponse accordingly.
The HTML template can be a bundled file under src/climate_api/data/templates/ loaded via importlib.resources, or an inline Jinja2 template — keep it simple.
Status data (extent, ingestion count) should be fetched server-side so the page is useful without JavaScript.
The page should degrade gracefully when no extent is configured or no datasets have been ingested yet.
Background
GET /currently returns a JSON navigation object (RootResponse). Following the pattern used by TiTiler and OGC APIs, the root endpoint should serve an HTML landing page by default, with?f=json(orAccept: application/json) returning the existing JSON response.Proposed behaviour
GET /GET /?f=jsonRootResponse)GET /withAccept: application/jsonRootResponse)Landing page content
The HTML page should be self-contained (no external CDN dependencies) and include:
GET /extentGET /datasets/maps(see Map viewer at /maps with STAC-backed display metadata #66)/docs/ogcapi//stac/catalog.jsonGET /info)Implementation notes
system/routes.pyon the existingGET /handler: checkrequest.query_params.get("f")andrequest.headers.get("accept"), returnHTMLResponseorJSONResponseaccordingly.src/climate_api/data/templates/loaded viaimportlib.resources, or an inline Jinja2 template — keep it simple./maps) even before Map viewer at /maps with STAC-backed display metadata #66 is implemented — the link can simply be inactive/greyed-out until that work lands.Related
/maps