plumber
plumber copied to clipboard
Documentation issues
- Exit hooks are possible, and very useful for e.g. closing db connections, but
exit
as an allowable stage is not documented. Example:
con <- DBI::dbConnect(odbc::odbc(), "my_db")
pr %>%
plumber::pr_hook("exit", function(req) {
DBI::dbDisconnect(con)
})
- Hook stages are not explained. e.g. when is "preserialize"?
- It's not clear from the docs how to use hooks and deploy to RStudio Connect (or in general?). From the plumber examples repo, I figured out there's an
@plumber
comment + a function that takespr
as an argument. I just copied this boilerplate, but can't find anywhere this is explained.