GithubHelp home page GithubHelp logo

Comments (7)

ColinFay avatar ColinFay commented on May 24, 2024 1

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.

Brabin3 avatar Brabin3 commented on May 24, 2024

Hey, Thank you!

Your help is greatly appreciated.

from brochure.

jjfantini avatar jjfantini commented on May 24, 2024

Has there been any progress made with using shinyProxy and Docker? I was looing to use this deployment avenue myself, @ColinFay @Brabin3

from brochure.

ColinFay avatar ColinFay commented on May 24, 2024

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.

jjfantini avatar jjfantini commented on May 24, 2024

@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.

jjfantini avatar jjfantini commented on May 24, 2024

@ColinFay so the basepath argument should be url/myapp and the following brochurePages() should be href = 'myapp/page'?

from brochure.

teofiln avatar teofiln commented on May 24, 2024

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:

  1. adding baseurl = app_name in run_app()
  2. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.