Enhanced HTTP methods support for multiple endpoints
Value
A function that takes a request object and returns either the regular UI (for GET requests) or an HTTP response (for other HTTP methods). This function should be passed to shinyApp() as the ui parameter.
Examples
if (interactive()) {
endpoints <- list(
list(path = "/api/data", methods = c("POST", "PUT"), token = "secret"),
list(path = "/api/delete", methods = "DELETE", token = "admin-token"),
list(path = "/webhooks", methods = c("POST", "PATCH"))
)
ui <- payload_methods(fluidPage(h1("My App")), endpoints)
shinyApp(ui, server, uiPattern = ".*")
}