-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebapp.R
More file actions
60 lines (47 loc) · 1.33 KB
/
webapp.R
File metadata and controls
60 lines (47 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#' @title Build and Launch the Web Application
#'
#' @description `run_app` constructs and launches a local version of the web application by running [`shiny::runApp`] pointed to the `app` subdirectory.
#' `global_list` creates a list of values that are globally available in an app run.
#'
#' @param main `character` value of the name of the main component of the directory tree.
#'
#' @return `global_list`: a `list` of values that will be globally available in the app. \cr
#' `run_app` runs the app itself.
#'
#' @name app
#'
#' @family shinyapp
#'
#' @aliases web-app app
#'
NULL
#' @rdname app
#'
#' @export
#'
run_app <- function(main = ".") {
runApp(appDir = app_path(main = main))
}
#' @rdname app
#'
#' @export
#'
deploy_app <- function(main = ".") {
setAccountInfo(name = Sys.getenv("SHINY_ACCOUNT"),
token = Sys.getenv("SHINY_TOKEN"),
secret = Sys.getenv("SHINY_SECRET"),
server = "shinyapps.io")
deployApp(appDir = app_path(main = main),
appFiles = "..",
forceUpdate = TRUE,
appName = "ShinyDocker")
}
#' @rdname app
#'
#' @export
#
global_list <- function (main = ".") {
settings <- read_directory_settings(main = main)
messageq("HI!", quiet = !settings$verbose)
list(settings = settings$quiet)
}