How to add a base handler, and stop getting RStudio Connect to add the default handler.

I have a plumber API, that is being deployed by RStudio Connect automatically from GitHub (Posit Connect Documentation Version 2024.02.0 - Git-Backed Content).
The default URL redirects to Swagger docs (this is good), however, it is adding an "endpoint" that says "RStudio Connect added this endpoint to redirect to the API docs by default. Once you define a base handler (i.e.: GET /), RStudio Connect will stop adding this redirector.".
image
An example of this issue can be found here (not our app) https://colorado.rstudio.com/rsc/traffic-crashes/__docs__/

How can I avoid getting this message?

As a workaround I have added this endpoint

#* Documentation Path
#*
#* @tag Documentation
#* @html
#*
#* @get /
#*
function(req, res) {
  res$status <- 303 # redirect
  res$setHeader("Location", "./__docs__/")
  "<html><head><meta http-equiv=\"Refresh\" content=\"0; url=./__docs__\" /></head></html>"
}

But I would rather prefer hiding this endpoint from the documentation.

Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.