rcpp_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 Plumber Example API
#* @apiDescription Plumber example description.

#* run the rcpp script hello world
#* @get /hello_world
function() {
    rcpp_hello_world()
}

#* run the standard r hello script
#* @get /hello
function() {
    hello()
}


# Programmatically alter your API
#* @plumber
function(pr) {
    pr %>%
        # Overwrite the default serializer to return unboxed JSON
        pr_set_serializer(serializer_unboxed_json())
}
reinout91/rcppTestProject documentation built on May 4, 2022, 12:35 a.m.