Skip to content

Conversation

thomasp85
Copy link
Collaborator

Fix #836

The apiPath option was never used during the actual mounting of the docs router - only for reporting the url of it.

This is now fixed.

@schloerke can you please advise me where tests for this bug (and the fix) are best placed?

@schloerke schloerke added this to the v1.3.0 milestone Jan 29, 2025
quiet = quiet
)
on.exit(unmount_docs(self, docs_info), add = TRUE)
#on.exit(unmount_docs(self, docs_info), add = TRUE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this still needs to be there as the docs will want to be mounted again on a followup run.

@schloerke
Copy link
Collaborator

Instead of altering just the docs, should we adjust how pr$handle() and pr$mount() will prepend the path portion of

plumber/R/ui.R

Lines 12 to 22 in 5980d1e

# Build api url
api_url <- get_option_or_env(
"plumber.apiURL",
urlHost(
scheme = get_option_or_env("plumber.apiScheme", "http"),
host = get_option_or_env("plumber.apiHost", host),
port = get_option_or_env("plumber.apiPort", port),
path = get_option_or_env("plumber.apiPath", ""),
changeHostLocation = TRUE
)
)

If we do not apply it internally to the two methods, we should still use the path portion of the api_url when mounting the docs.

@schloerke schloerke removed this from the v1.3.0 milestone Feb 18, 2025
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

Successfully merging this pull request may close these issues.

global basepath

2 participants