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.".
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!