Autoset routes and requests pathname prefixes if DASH_APP_NAME is set#165
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.
I made a slight change here to fix the conditional statement.
There was a problem hiding this comment.
🤦♂ Yep, one too many else if statements here.
HammadTheOne
left a comment
There was a problem hiding this comment.
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_prefixandself$requests_pathname_prefix:routes_pathname_prefixorrequests_pathname_prefixhas been passed to Dash for R directly, and use if availableDASH_ROUTES_PATHNAME_PREFIXorDASH_REQUESTS_PATHNAME_PREFIXhave been set in current environment, and use if availableDASH_APP_NAMEhas been set in environment, and use if availableDASH_URL_BASE_PATHNAMEhas been set in environment, and use if availablebase_pathnameif resolution fails as directed aboveIn addition, the function name is camelCased instead of using snake case.