This function allows you to combine two separate routes into one. This is
different from combining them in a routestack, because a request is only
matched to one handler in each route (thus combining them with
route_merge()
will ensure only one handler is called).
Arguments
- x, route
Route objects to merge.
route
will be merged intox
- use_root
Should the root of
route
be added to all its paths before it is merged intox
Examples
route() |>
route_add("HEAD", "*", function(...) {
message("Someone's looking")
TRUE
}) |>
route_merge(
sizelimit_route()
)
#> A route with 2 handlers
#> Warning: first element used of 'length.out' argument
#> head:
#> • *
#> all:
#> • *