Route templates: a route named x-* serves any request route x-<something>

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-25 13:38:24 -07:00
parent 4863e53eb8
commit 4e1dd03d07
10 changed files with 344 additions and 9 deletions
+3 -1
View File
@@ -173,7 +173,9 @@ func (hx *handler) routesGet(w http.ResponseWriter, r *http.Request) {
func (hx *handler) routeView(route string, hosts []string, defaultModel string, snap []lease.Lease) RouteView {
leases := make([]LeaseView, 0)
for _, l := range snap {
if l.Route == route {
// A concrete route lists under the exact key it matches, or the longest
// template that matches it; a template's row is every such lease.
if _, key, ok := hx.cfg.Route(l.Route); ok && key == route {
leases = append(leases, leaseView(l))
}
}