Comments (7)
Hey,
Yeah there is an issue with the way shiny proxy works — it iframes the actual app so there might be an issue with that.
I will have a look and let you know
from brochure.
Hey, Thank you!
Your help is greatly appreciated.
from brochure.
Has there been any progress made with using shinyProxy and Docker? I was looing to use this deployment avenue myself, @ColinFay @Brabin3
from brochure.
Two q for @Brabin3 :
-> Do you have specified a basepath
in your brochureApp ? by default brochure assumes that your app is at url/
, but shinyproxy deploys at url/myapp
-> Do the link inside your app redirect to url/myapp/mypage
or to url/mypage
?
@jjfantini I'll work on this, my only current issue is that it requires some time to have a shiny proxy running, a container with a brochure app, and all that is implied by that :)
from brochure.
@ColinFay that sounds great, I will try to flesh out issues here that I run into when deploying with this method, think it would be helpful for users down the road to have this one paved...looking forward to a fully isolated app environment that is isolated further with brochure -- the data flow design is much better when so explicit. Look forward to the journey ahead :) bear with me, v new to web dev
from brochure.
@ColinFay so the basepath
argument should be url/myapp
and the following brochurePages()
should be href = 'myapp/page'
?
from brochure.
I have something similar on shinyapps.io, where the apps url is: username.shinyapps.io/app_name
. Because the base url is /app_name
, and not just /
, the redirects also do not work out of the box.
I was able to get things working by:
- adding
baseurl = app_name
inrun_app()
- converting all the redirect links from
/pageX
to/app_name/pageX
So now things work well on shinyapps.io, but not locally, as the local url does not have the /app_name
suffix.
To fix this we can dynamically generate the redirect href based on getOption("baseurl"). Some function like:
#' make_href
#'
#' @description Add appropriate prefix to redirect link depending on context (option baseurl)
#' @param endpoint endpoint without leading `/`
#' @noRd
make_href <- function(endpoint) {
baseurl <- getOption("baseurl")
if (baseurl != "") {
paste0("/", baseurl, "/", endpoint, sep = "")
} else {
paste0("/", endpoint, sep = "")
}
}
Then, in /dev/run_dev.R
we can set
options(baseurl = "")
> make_href("")
[1] "/"
> make_href("page2")
[1] "/page2"
# then run app should work with unprefixed hrefs
run_app()
In 'production' mode on shinyapps.io, we can add the baseurl option in app.R
just before calling run_app()
:
options(baseurl = "my_app")
> make_href("")
[1] "/my_app/"
> make_href("page2")
[1] "/my_app/page2"
# then run app should work with prefixed hrefs
run_app()
Maybe something similar will work in shinyProxy?
from brochure.
Related Issues (20)
- adding a "www" folder to my app caused it to unexpectedly break HOT 5
- shinyashboard doesn't refresh page, it opens a new one HOT 2
- test golem recommended don't work HOT 1
- Add test for default page
- reactLog error HOT 4
- wrapped should default to tagList in brochureApp HOT 1
- redirect() function injects "<script>$( document ).ready(function().." into body of bs4Dashh::dashboardPage() HOT 4
- Clarify the way brochureApp() handles `..`
- Css not recognized when adapting traditional golem app to brochure [solved]
- Creating a brochure app through golem does not import `{brochure}` HOT 2
- Brochure hex logo
- Strange EOF issue when POSTing JSON HOT 1
- Is there a need to use inner-session async in `brochure` pages?
- Page redirection fails for rstudio server HOT 2
- Brochure adds unnecessary container-fluid HOT 4
- Start from within RStudio
- feat: path should match based on regex
- bug: sub-path not working HOT 1
- Bootswatch-themes per page don't get applied
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brochure.