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>
- Add /docs route serving web/templates/api.html: full Bootstrap 5
documentation page covering all three API endpoints with parameter
tables, example requests, and example responses
- Add 'API docs' link to the navbar on the main map page
- Update README.md: add web frontend section with feature list, dev
server instructions, and API endpoint summary table
- Update AGENTS.md: add web/ layout, API endpoint table, Flask run
instructions, and route_master example relation IDs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>