inst/examples/plumber/index.R

#!/usr/bin/env Rscript

library(plumber)
library(rconfig)
CONFIG <- rconfig()
TEST <- value(CONFIG$test, FALSE)
message("Mode: ", if (TEST) "Test" else "Prod")

pr("handler.R") |>
    pr_run(
        port = value(CONFIG$port, 8080)
    )

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.