find-my-way
Advanced tools
Comparing version 1.15.2 to 1.15.3
@@ -27,3 +27,3 @@ 'use strict' | ||
this.parametricBrother = null | ||
this.versions = SemVerStore() | ||
this.versions = versions || SemVerStore() | ||
} | ||
@@ -30,0 +30,0 @@ |
{ | ||
"name": "find-my-way", | ||
"version": "1.15.2", | ||
"version": "1.15.3", | ||
"description": "Crazy fast http radix based router", | ||
@@ -32,4 +32,4 @@ "main": "index.js", | ||
"pre-commit": "^1.2.2", | ||
"request": "^2.87.0", | ||
"standard": "^11.0.1", | ||
"request": "^2.88.0", | ||
"standard": "^12.0.1", | ||
"tap": "^12.0.1" | ||
@@ -36,0 +36,0 @@ }, |
@@ -171,11 +171,23 @@ # find-my-way | ||
##### Match order | ||
The routes are matched in the following order: | ||
``` | ||
static | ||
parametric | ||
wildcards | ||
parametric(regex) | ||
multi parametric(regex) | ||
``` | ||
The routing algorithm matches one chunk at a time (where the chunk is a string between two slashes), | ||
this means that it cannot know if a route is static or dynamic until it finishes to match the URL. | ||
The chunks are matched in the following order: | ||
1. static | ||
1. parametric | ||
1. wildcards | ||
1. parametric(regex) | ||
1. multi parametric(regex) | ||
So if you declare the following routes | ||
- `/:userId/foo/bar` | ||
- `/33/:a(^.*$)/:b` | ||
and the URL of the incoming request is /33/foo/bar, | ||
the second route will be matched because the first chunk (33) matches the static chunk. | ||
If the URL would have been /32/foo/bar, the first route would have been matched. | ||
<a name="supported-methods"></a> | ||
@@ -182,0 +194,0 @@ ##### Supported methods |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130683
31
3707
306