Skip to content

Commit

Permalink
Create prometheus_endpoint.R
Browse files Browse the repository at this point in the history
  • Loading branch information
JBris authored Mar 1, 2024
1 parent be57f1e commit d88220f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions getting_started/prometheus_endpoint.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
library(shiny)
library(jsonlite)
library(callr)
library(datasets)

ui <- function(req) {

query_params <- parseQueryString(req$QUERY_STRING)
body_bytes <- req$rook.input$read(-1)
print(query_params)
print(body_bytes)

if (identical(req$REQUEST_METHOD, "GET")) {

if(req$PATH_INFO == "/") {
fluidPage(
h1("Accepting POST requests from Shiny")
)
}
}
}
#attr(ui, "http_methods_supported") <- c("GET", "POST")

server <- function(input, output, session) {}

#app <- shinyApp(ui, server, uiPattern = ".*")

app <- shinyApp(ui, server)
openmetrics::register_shiny_metrics(app, registry = openmetrics::global_registry())

0 comments on commit d88220f

Please sign in to comment.