From 50cf51007dc38be6aaa22f6413d9d85d235c8f50 Mon Sep 17 00:00:00 2001 From: Douglas-Lee Date: Thu, 11 Jan 2024 23:50:49 +0800 Subject: [PATCH 1/2] WIP --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 9c2e396..34ccddf 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,18 @@ router.trie = / nil └─{catchall} { "/src/{*filename}", * } ``` +## Route precedence + +path precedence from highest to lowest is: + +- literal path: `/html/index.html` +- patterned path: path with lesser patterns has higher precedence. + - `/a/{var}/bb` is higher than `/a/{var}/b{value}` + + +- first registered first match +- + ## 🚀 Benchmarks From 591882b244dabafad3cc6079f1f0e4e2d77eb422 Mon Sep 17 00:00:00 2001 From: Douglas-Lee Date: Tue, 16 Jan 2024 23:52:54 +0800 Subject: [PATCH 2/2] use a short link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34ccddf..a710a61 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ assert(params.year == "2023") assert(params.format == "pdf") ``` -For more usage samples, please refer to the [/samples](/samples) directory. For more use cases, please check out https://github.com/vm-001/lua-radix-router-use-cases. +For more usage samples, please refer to the [/samples](/samples) directory. For more use cases, please check out [lua-radix-router-use-cases](https://github.com/vm-001/lua-radix-router-use-cases). ## 📄 Methods