pr_mount | R Documentation |
Plumber routers can be “nested” by mounting one into another
using the mount()
method. This allows you to compartmentalize your API
by paths which is a great technique for decomposing large APIs into smaller
files. This function mutates the Plumber router (pr()
) in place and
returns the updated router.
pr_mount(pr, path, router)
pr |
The host Plumber router. |
path |
A character string. Where to mount router. |
router |
A Plumber router. Router to be mounted. |
A Plumber router with the supplied router mounted
## Not run: pr1 <- pr() %>% pr_get("/hello", function() "Hello") pr() %>% pr_get("/goodbye", function() "Goodbye") %>% pr_mount("/hi", pr1) %>% pr_run() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.