Skip to contents

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

Usage

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

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

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.

Examples

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