Skip to content

HTML landing page on / #68

@turban

Description

@turban

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 (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
  • Navigation links:
  • Version info (app version, from GET /info)

Implementation notes

  • 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.
  • Link to the map viewer (/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions