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

Support mounting using pr_mount() without a trailing slash #952

Open
gacolitti opened this issue Apr 28, 2024 · 0 comments
Open

Support mounting using pr_mount() without a trailing slash #952

gacolitti opened this issue Apr 28, 2024 · 0 comments

Comments

@gacolitti
Copy link

I want to be able to mount routers without a trailing slash. As far as I can tell, this is not supported.

Here is an example:

library(plumber)
pr1 <- pr_get(pr(), "/", function() {})

pr() |> 
  pr_mount("/api/test", pr1) |> 
  pr_run(port = 8322)

I want the endpoint to be /api/test, but instead it becomes /api/test/ and I'm not sure how to remove the trailing slash.

I tried doing:

pr1 <- pr_get(pr(), "", function() {})

but that returns the same endpoint as before.

Maybe there can be an additional argument to pr_mount() to control this behavior:

pr_mount(ignore_trailing_slashes = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant