diff --git a/R/app.R b/R/app.R index 74b232d8..df2e3821 100644 --- a/R/app.R +++ b/R/app.R @@ -161,20 +161,28 @@ app <- function() { entrypoint <- read_config()$legacy_entrypoint if (identical(entrypoint, "app_dir")) { - return(shiny::shinyAppDir("app")) - } - - if (identical(entrypoint, "source")) { + shiny::shinyAppDir("app") + } else if (identical(entrypoint, "source")) { main <- new.env() source(fs::path("app", "main.R"), local = main) - } else { + shiny::shinyApp( + ui = with_head_tags(main$ui), + server = main$server + ) + } else if (identical(entrypoint, "box_top_level")) { main <- load_main_module() - if (!identical(entrypoint, "box_top_level")) { - main <- as_top_level(main) - } + shiny::shinyApp( + ui = with_head_tags(main$ui), + server = main$server + ) + } else if (is.null(entrypoint)) { + main <- load_main_module() + main <- as_top_level(main) + shiny::shinyApp( + ui = with_head_tags(main$ui), + server = main$server + ) + } else { + stop() } - shiny::shinyApp( - ui = with_head_tags(main$ui), - server = main$server - ) }