View source: R/plumber-add_service.R
add_service | R Documentation |
Expose additional set of services on a separate URL.
add_service(path = ".", name, overwrite = FALSE)
path |
( |
name |
( |
overwrite |
( |
Lay the infrastructure for an additional set of services. That includes adding a unit test, adding an endpoint, and extending the entrypointy.<div class="alert alert-warning"> **Note:** 'add_service' adds a service to pre-existing plumber microservice which you could deploy by calling 'use_microservice'. </div>
Given a path
to a folder and a service name
When add_service(path, name)
is called
Then the function creates the following files:
tests/testthat/test-endpoint-plumber-{route_name}.R inst/endpoints/plumber-{route_name}.R
And updates the following files:
inst/entrypoints/plumber-foreground.R
In scenarios where services are thematically linked to each other. Examples for themes that should be mounted separately:
'forecasting' and 'anomaly detection'
'user' and 'business'
No return value, called for side effects.
Other plumber microservice:
use_microservice()
path <- tempfile() dir.create(path, showWarnings = FALSE, recursive = TRUE) use_microservice(path) add_service(path, name = "repository") list.files(path, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.