plumber::register_serializer("fake", function(){
function(val, req, res, errorHandler){
tryCatch({
json <- jsonlite::toJSON(val)
res$setHeader("Content-Type", "application/json")
res$body <- paste0("FAKE", json)
return(res$toResponse())
}, error=function(e){
errorHandler(req, res, e)
})
}
})
pr("./plumber.R")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.