#
# 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())
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.