vignettes/files/apis/07-03-file-unsafe.R

#* This is an example of an UNSAFE endpoint which
#* does not sanitize user input
#* @get /
#* @query file:string*
function(query) {

  # An example of an UNSAFE endpoint.
  path <- file.path("./datasets", query$file)
  readLines(path)
}

Try the plumber2 package in your browser

Any scripts or data that you put into this service are public.

plumber2 documentation built on Jan. 20, 2026, 5:06 p.m.