Skip to content

Instantly share code, notes, and snippets.

@ColinFay
Created December 2, 2020 20:15
Show Gist options
  • Save ColinFay/102bde7e86d1223c0135f5c1d8dfd8de to your computer and use it in GitHub Desktop.
Save ColinFay/102bde7e86d1223c0135f5c1d8dfd8de to your computer and use it in GitHub Desktop.
library(shiny)
ui <- fluidPage()
server <- function(input, output, session) {
}
# Creating the shiny object
res <- shinyApp(ui, server)
# Altering the httpHandler
res$httpHandler <- function(req){
# getting shiny:::httpResponse
httpResponse <- getFromNamespace("httpResponse", "shiny")
# Doing a 301 redirect
return(httpResponse(
status = 301,
headers = list(
Location = "https://colinfay.me"
)
))
}
# Run the app
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment