This function exports a Shiny app to a directory, which can then be served
using httpuv
.
Usage
export(
appdir,
destdir,
...,
subdir = "",
verbose = is_interactive(),
wasm_packages = TRUE,
package_cache = TRUE
)
Arguments
- appdir
Directory containing the application.
- destdir
Destination directory.
- ...
Ignored
- subdir
Subdirectory of
destdir
to write the app to.- verbose
Print verbose output. Defaults to
TRUE
if running interactively.- wasm_packages
Download and include binary WebAssembly packages as part of the output app's static assets. Defaults to
TRUE
.- package_cache
Cache downloaded binary WebAssembly packages. Defaults to
TRUE
.
Value
Nothing. The app is exported to destdir
. Instructions for serving
the directory are printed to stdout.
Examples
if (FALSE) { # interactive()
app_dir <- system.file("examples", "01_hello", package = "shiny")
out_dir <- tempfile("shinylive-export")
# Export the app to a directory
export(app_dir, out_dir)
# Serve the exported directory
if (require(httpuv)) {
httpuv::runStaticServer(out_dir)
}
}