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

Mount docs as first mount #882

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Mount docs as first mount #882

wants to merge 18 commits into from

Conversation

schloerke
Copy link
Collaborator

@schloerke schloerke commented Sep 28, 2022

Fixes #881

Other changes:

  • working directory is restored last, not before the exit hooks are run.

PR task list:

  • Update NEWS
  • Add tests
  • Update documentation with devtools::document()

cc @aronatkins

R/plumber.R Show resolved Hide resolved
@jcheng5
Copy link
Member

jcheng5 commented Sep 29, 2022

Sorry, I don't understand these changes--can you walk me through them tomorrow?

@schloerke
Copy link
Collaborator Author

Will do!

@jcheng5
Copy link
Member

jcheng5 commented Sep 29, 2022

I suggest adding a prepend = TRUE argument to pr$mount() and then not having to pass pr_private

@schloerke
Copy link
Collaborator Author

schloerke commented Oct 5, 2022

  • Run latest GitHub actions on workflow to document
  • Merge

@schloerke schloerke requested a review from jcheng5 October 5, 2022 17:14
@@ -299,7 +307,15 @@ Plumber <- R6Class(
path <- paste0(path, "/")
}

private$mnts[[path]] <- router
# Remove prior mount if it exists
self$unmount(path)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you want to do this unmount...? With #883, you'll be able to mount two subrouters to one path and have one fall through to the other.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll be sure to address that in the PR. There's a lot of decisions to be made in #883

For now, I'd like to keep existing behavior where it was overwritten.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

And if you still do want to unmount, I think you would then need to factor in how it affects the after index if it's a non-NULL, non-zero value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmmmm. Let's keep this in draft to see if we're even going to merge #883

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.

root static file handler causes /__docs__/ to 404
2 participants