Skip to content

Launch in browser using run_dev() #1193

@howardbaik

Description

@howardbaik

Currently, when I run apps in development using run_dev(), the app launches within the RStudio Viewer. I'd prefer it to open in a browser instead.

As a workaround, I've modified the run_app() function to include launch.browser = TRUE in the options argument:

run_app <- function(
  onStart = NULL,
  options = list(shiny.autoreload = TRUE,
                 launch.browser = TRUE), # <-- Launch in browser
  enableBookmarking = NULL,
  uiPattern = "/",
  ...
) {
  with_golem_options(
    app = shinyApp(
      ui = app_ui,
      server = app_server,
      onStart = onStart,
      options = options,
      enableBookmarking = enableBookmarking,
      uiPattern = uiPattern
    ),
    golem_opts = list(...)
  )
}

While this works, it feels a bit hacky since it requires modifying and committing changes to the codebase.

Is there a more "golem-native" way to launch the development app in the browser?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions