inst/api/plumber.R

#
# This is a Plumber API. You can run the API by clicking
# the 'Run API' button above.
#
# Find out more about building APIs with Plumber here:
#
#    https://www.rplumber.io/
#

library(plumber)

#* @apiTitle Loss Reserving API
#* @apiDescription An Actuarial API for dealing with Loss Reserving Data and Workflows.


# Utility Endpoints -------------------------------------------------------

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

# Programmatically alter your API
#* @plumber
function(pr) {
  pr %>%
    # Overwrite the default serializer to return unboxed JSON
    pr_set_serializer(serializer_unboxed_json())
}
jimbrig/lossrx documentation built on Dec. 20, 2024, 3:46 a.m.