vignettes/files/apis/07-02-plot-safe.R

#* This is an example of an safe endpoint which
#* checks user input to avoid a DOS attack
#* @get /
#* @serializer png
function(pts=10) {
  if (pts > 1000 & pts > 0){
    stop("pts must be between 1 and 1,000")
  }

  plot(1:pts)
}
rstudio/plumber documentation built on April 12, 2025, 7:33 p.m.