inst/examples/plumber/handler.R

#* Echo back the input
#* @param msg The message to echo
#* @post /echo
function(msg="") {
    list(msg = paste0(
        value(CONFIG$title, "The message is"),
        ": '", msg, "'"))
}

#* Return tets or prod mode
#* @get /test
function() {
    list(mode = if (TEST) "test" else "prod")
}

Try the rconfig package in your browser

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

rconfig documentation built on July 9, 2023, 7:01 p.m.