inst/examples/modify_req/app.R

library(shiny)
library(tower)


ui <- fluidPage()
server <- function(input, output) { }

shinyApp(ui, server) |>
  create_tower() |>
  add_http_layer(function(req) {
    req$NEW_DATA <- "new data"
    return(NULL)
  }) |>
  add_http_layer(function(req) {
    req$NEW_DATA <- paste0(req$NEW_DATA, " and more data")
    return(NULL)
  }) |>
  add_http_layer(function(req) {
    print(req$NEW_DATA)
    return(NULL)
  }) |>
  build_tower()

Try the tower package in your browser

Any scripts or data that you put into this service are public.

tower documentation built on Oct. 30, 2024, 9:28 a.m.