Is it possible to pass multiple file in plumb method?
it is better to use this way
if(!exists("initiate", mode="function")) source(paste0(props['r_script_path', 1], "include_utils.r"))
Currently no.
You can mount multiple routers into a larger router though.
library(plumber)
f1_pr <- plumber$new("FILE_1.R")
f2_pr <- plumber$new("FILE_2.R")
master_pr <- plumber$new()
master_pr$mount("/f1", f1_pr)
master_pr$mount("/f2", f2_pr)
All of the routes of f1_pr
will start with the path /f1
. And with f2
, all of it's routes will start with /f2
.
See #266
Most helpful comment
Currently no.
You can mount multiple routers into a larger router though.
All of the routes of
f1_pr
will start with the path/f1
. And withf2
, all of it's routes will start with/f2
.