@absolunet/ioc2.1.0

View on GitHub

RouteRepository

Route repository that stores all the routes made from the router.

Methods

add(route)

Source:
Add a route instance.
Parameters:
Name Type Description
route http.Route The route instance to add.
Returns:
The current route repository instance.
Type
http.repositories.RouteRepository

all()

Source:
Get all route instances.
Returns:
A list of all the registered routes.
Type
Array.<Route>

findByName(name)

Source:
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)

Source:
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)

Source:
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