Skip to contents

Add 3 files, one is the route definition that will be exposed to your plumber router on calling `get_internal_routes()` [from generate_api_.R generated by `lay_pipework()`, stored at inst/extdata/api/routes/] A second file R/api_my_route.R will be generated, this is the wrapper for your core logic for the API. It will receive the request, typically then call another function. The third file is R/<route_name>.R for creating the logic behind the routed request.

Usage

add_route(
  route,
  method = c("get", "post", "put", "delete", "head", "options", "patch", "use")
)

Arguments

route

length 1 character vector, path to your endpoint. This could be any path relative to the root address of your router. e.g - "is_alive" - "test/is_alive"

method

length 1 character vector specifying HTTP method