Conversation
GET / now returns an HTML landing page showing the configured extent, ingested datasets with their temporal coverage and publication status, and navigation links to /maps, /docs, /ogcapi/, and /stac/catalog.json. GET /?f=json or Accept: application/json returns the existing JSON RootResponse, following the TiTiler / OGC API content negotiation pattern. The HTML template is self-contained (no external CDN) and is bundled as package data under src/climate_api/data/templates/index.html, loaded via importlib.resources so it works in both dev and pip-installed deployments. Jinja2 is added as an explicit dependency (was already a transitive dep via Starlette).
routes.py now only contains route handlers. Template loading, format negotiation (wants_json), and page rendering live in templates.py — a shared home for all server-rendered HTML pages, ready for the management UI (issue #72) to add to without touching routes.py.
data/ holds static data assets (YAML configs, pygeoapi base config). Templates are code-adjacent rendering artifacts and belong in their own top-level templates/ directory, consistent with Flask/Django convention.
- Cache app version at import time instead of per-request metadata lookup - Add PackageNotFoundError fallback for editable/dev installs - Declare explicit responses dict on GET / for accurate OpenAPI docs - Fix get_template docstring (data/templates/ -> templates/) - Narrow exception handling in render_landing; log unexpected errors - Pass base URL into template; prefix all hardcoded absolute links - Add OGC API link to Explore section
abyot
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #68.
What
`GET /` now returns an HTML landing page. `GET /?f=json` or a request with `Accept: application/json` returns the existing JSON `RootResponse` — the same content negotiation pattern used by TiTiler and OGC APIs.
Landing page content
Implementation