This function allows explicit creation of routes or addition/merging of a
predefined routr::Route into the router of the api. A new route can also be
created with the route
argument when adding a handler. However,
that way will always add new routes to the end of the stack, whereas using
api_add_route()
allows you full control of the placement.
Arguments
- api
A plumber2 api object to add the route to
- name
The name of the route to add. If a route is already present with this name then the provided route (if any) is merged into it
- route
The route to add. If
NULL
a new empty route will be created- header
Logical. Should the route be added to the header router?
- after
The location to place the new route on the stack.
NULL
will place it at the end. Will not have an effect if a route with the given name already exists.