inst/plumber/basic-test-api.R

# this is a basic test api

#' Echo the parameter that was sent in
#' @param msg The message to echo back
#' @get /echo
function(msg=""){
 list(msg = paste0("The message is '", msg, "'")) 
}

#' Plot a histogram
#' @png
#' @get /plot
function(){
  rand <- rnorm(1000)
  hist(rand)
}
chapmandu2/gapminderpl documentation built on May 9, 2019, 8:42 a.m.