|
|
|
@ -24,7 +24,7 @@ Or a class method:
|
|
|
|
|
|
|
|
|
|
Routes are matched in the order they are defined. The first route to match a request will be invoked.
|
|
|
|
|
|
|
|
|
|
## Method Routing
|
|
|
|
|
### Method Routing
|
|
|
|
|
|
|
|
|
|
By default, route patterns are matched against all request methods. You can respond to specific
|
|
|
|
|
methods by placing an identifier before the URL.
|
|
|
|
@ -45,7 +45,7 @@ You can also map multiple methods to a single callback by using a `|` delimiter:
|
|
|
|
|
|
|
|
|
|
Method specific routes have precedence over global routes.
|
|
|
|
|
|
|
|
|
|
## Regular Expressions
|
|
|
|
|
### Regular Expressions
|
|
|
|
|
|
|
|
|
|
You can use regular expressions in your routes:
|
|
|
|
|
|
|
|
|
@ -53,7 +53,7 @@ You can use regular expressions in your routes:
|
|
|
|
|
// This will match /user/1234
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
## Named Parameters
|
|
|
|
|
### Named Parameters
|
|
|
|
|
|
|
|
|
|
You can specify named parameters in your routes which will be passed along to your callback function.
|
|
|
|
|
|
|
|
|
@ -68,7 +68,7 @@ You can also include regular expressions with your named parameters by using the
|
|
|
|
|
// But will not match /bob/12345
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
## Wildcards
|
|
|
|
|
### Wildcards
|
|
|
|
|
|
|
|
|
|
Matching is only done on individual URL segments. If you want to match multiple segments you can use the `*` wildcard.
|
|
|
|
|
|