Methods
add(route)
Add a route instance.
Parameters:
Name | Type | Description |
---|---|---|
route |
http.Route | The route instance to add. |
Returns:
The current route repository instance.
all()
Get all route instances.
Returns:
A list of all the registered routes.
- Type
- Array.<Route>
findByName(name)
Find a route by given name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The route name. |
Returns:
The found route instance, or null if not found.
- Type
- http.Route | null
findByPath(path)
Find routes that match given path.
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The route path. |
Returns:
A list of routes that match the given path.
- Type
- Array.<Route>
findByPathForMethod(path, method)
Find a route by path and method.
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The route path. |
method |
string | The HTTP method. |
Returns:
The found route instance, or null if not found.
- Type
- http.Route | null