openstreetmap-tools/web
Edward Betts 17df83d043 Use url_for() for all internal URLs; fix ProxyPass compatibility
All hardcoded paths (/load, /docs, /, /api/route/ etc.) are replaced
with url_for() in templates, so Flask's APPLICATION_ROOT and
ProxyFix generate correct URLs regardless of mount path.

For app.js (a static file), inject a URLS object from the template
alongside RELATION_ID:
  URLS.routeApi, .segmentApi, .routeMasterApi, .routePage
Each is generated with url_for(..., relation_id=0)[:-1] to give a
prefix that JS appends relation IDs to. The popstate handler now
strips the URLS.routePage prefix instead of matching a hardcoded
leading slash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 20:31:01 +00:00
..
static Use url_for() for all internal URLs; fix ProxyPass compatibility 2026-02-27 20:31:01 +00:00
templates Use url_for() for all internal URLs; fix ProxyPass compatibility 2026-02-27 20:31:01 +00:00
app.py Add API docs page and update README/AGENTS 2026-02-27 19:03:37 +00:00