rstudio/plumber

document that local variables are ok

Open

#330 opened on Nov 2, 2018

View on GitHub
 (0 comments) (0 reactions) (0 assignees)R (1,437 stars) (257 forks)batch import
difficulty: novicedocseffort: lowhelp wanted

Description

The router below works as expected.

#* @get /a
(function(){
  cat("sourced!\n")
  function() {
    valueA
  }
})()

#* @get /b
function() {
  valueA
}

valueA <- 4

It should be added to the documentation here: https://www.rplumber.io/docs/runtime.html#environments

Ref: https://github.com/trestletech/plumber/issues/329

Contributor guide