diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/pathtree.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/pathtree.go b/internal/pathtree.go index 3861c8e..25d000d 100644 --- a/internal/pathtree.go +++ b/internal/pathtree.go @@ -38,7 +38,11 @@ type Route[V any] struct { } func (pt PathTree[V]) Routes() []Route[V] { - return pt.tree.routes() + routes := pt.tree.routes() + if pt.root != nil { + routes = append([]Route[V]{{Pattern: "", Value: *pt.root}}, routes...) + } + return routes } // pattern segment which must be a specific string ("/users/"). |