Better routing #8
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Chewing_Bever/lnm#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. 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,
/:varfor matching a single keyword, or/*varfor 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
/apiroutes 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.