-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Autoset routes and requests pathname prefixes if DASH_APP_NAME is set #165
Conversation
Fixes conditional statement to resolve installation error.
env_base_pathname <- Sys.getenv("DASH_URL_BASE_PATHNAME") | ||
app_name <- Sys.getenv("DASH_APP_NAME") | ||
|
||
if (prefix_env != "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a slight change here to fix the conditional statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂ Yep, one too many else if
statements here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Ryan,
After checking out the changes and testing out a couple of deployments to DE, it looks like the changes work well and the autoset prefixes add a bit of convenience as a first step to making the apps easier to deploy on DE.
There was a slight issue with a conditional but that's been sorted out with the last commit. I did notice however, that the changes aren't backwards compatible, I had to remove the references to some of the environment variables declared in previous versions of the deployment template, but I think (based on our discussion earlier) that that's by design and should be fine going forward with future apps/deployments.
💃
Thanks @HammadTheOne. There are definitely some changes introduced as a result of all this work, but the end effect is a smoother, simpler deployment process overall. |
I find this surprising. Which line of code is backwards incompatible? I would've expected that if these variables are already set (as in our current examples), they would continue to be used. |
I believe the line setting the
|
* Autoset routes and requests pathname prefixes (#165) * Inspect environment variables for host & port (#167) * Support for index page templating (#168) * Add support for config-aware relative paths (#172) * Add unit tests for index customization (#176) * Send status code of 1 when unit tests fail (#177)
This PR proposes to modify the resolution logic for
resolve_prefix
, which is called by Dash when settingself$routes_pathname_prefix
andself$requests_pathname_prefix
:routes_pathname_prefix
orrequests_pathname_prefix
has been passed to Dash for R directly, and use if availableDASH_ROUTES_PATHNAME_PREFIX
orDASH_REQUESTS_PATHNAME_PREFIX
have been set in current environment, and use if availableDASH_APP_NAME
has been set in environment, and use if availableDASH_URL_BASE_PATHNAME
has been set in environment, and use if availablebase_pathname
if resolution fails as directed aboveIn addition, the function name is camelCased instead of using snake case.