Better routing #8
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Chewing_Bever/lnm#8
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Regex isn't the best solution for matching routes, as it's rather cpu intensive. Instead, I'd like to implement parametrized routes using a trie-like structure, which would hopefully be much faster than the current methods.
This would support the usual expected stuff,
/:var
for matching a single keyword, or/*var
for matching multiple segments.Together with this, I'd like to introduce "routers", structs that allow defining multiple grouped routes which can then all be mapped to the same subpath on the main router, eg putting all
/api
routes into a single router.To do
Literal string matching
Single-segment wildcard matching
Output wildcard segment matches
Replace old router with new one
Add API functions for retrieving matched segments
For the API for accessing matched variables, we should introduce a trie for matching the variable names so they can be referenced using their names.