Reviving this topic as there is an official solution in plumber
v1.0.0 .
@julia's setup was a great inspiration!
- mypackage
|- R
|- utils.R
|- ...
|- inst
|- plumber
|- api1
|- plumber.R
|- api2
|- plumber.R
|- DESCRIPTION
|- ...
To plumber::plumb()
api1
in mypackage
:
plumber::plumb_api("mypackage", "api1")
To see the available APIs for mypackage
, call:
# For {mypackage}
plumber::available_apis("mypackage")
#> Available Plumber APIs:
#> * mypackage
#> - api1
#> - api2
# For all packages
plumber::available_apis()
#> Available Plumber APIs:
#> * mypackage
#> - api1
#> - api2
#> * plumber
#> - 01-append
#> - 02-filters
#> ....