Learn R Programming

shinypayload (version 0.1.0)

payload_ui: Wrap an existing UI with an integrated POST handler on the same port

Description

Wrap an existing UI with an integrated POST handler on the same port

Usage

payload_ui(base_ui, path = "/ingress", token = NULL)

Value

A function that takes a request object and returns either the regular UI (for GET requests) or an HTTP response (for POST requests). This function should be passed to shinyApp() as the ui parameter.

Arguments

base_ui

The original UI (tagList, fluidPage, or a function(req) returning UI)

path

The URL path to handle POST requests (default "/ingress")

token

Optional authentication token for POST requests

Examples

Run this code
if (interactive()) {
ui <- payload_ui(
  fluidPage(h1("My App")),
  path = "/data",
  token = "secret123"
)
shinyApp(ui, server, uiPattern = ".*")
}

Run the code above in your browser using DataLab