Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add arbitrary URL handlers #1394

Open
jcheng5 opened this issue Sep 29, 2016 · 2 comments
Open

Add arbitrary URL handlers #1394

jcheng5 opened this issue Sep 29, 2016 · 2 comments

Comments

@jcheng5
Copy link
Member

jcheng5 commented Sep 29, 2016

Similar to addResourcePath, but instead of a directory path, take a Rook function.

https://groups.google.com/forum/#!topic/shiny-discuss/J7kGarNBjBQ

And also @daattali and @hadley have asked for something similar.

This would not be anything close to our vision for what an enterprise-ready HTTP API server could look like, but for people who have Shiny apps that need callbacks (SNS is one, OAuth is another), this would be an open door to all sorts of opportunities.

@wch wch removed the backlog label Jun 13, 2018
@Tutuchan
Copy link

Hello,
Are there any news on this issue ?
Thanks in advance,
Pierre

@JohnCoene
Copy link

This is the way I go about it (to expose Prometheus metrics) but since 1.6 will export httpResponse we're halfway there it seems 🎉

res <- getFromNamespace("httpResponse", "shiny")
handlerManager <- getFromNamespace("handlerManager", "shiny")

handler <- function(req){
  if(!req$PATH_INFO == "/metrics")
    return()

  res(200L, "text/plain", "Hello world!")
}

handlerManager$addHandler(handler, "/metrics")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants