export {shinylive} | R Documentation |
Export a Shiny app to a directory
Description
This function exports a Shiny app to a directory, which can then be served
using httpuv
.
Usage
export(
appdir,
destdir,
...,
subdir = "",
quiet = getOption("shinylive.quiet", !is_interactive()),
wasm_packages = TRUE,
package_cache = TRUE,
assets_version = NULL,
template_dir = NULL,
template_params = list(),
verbose = NULL
)
Arguments
appdir |
Directory containing the application. |
destdir |
Destination directory. |
... |
Ignored |
subdir |
Subdirectory of |
quiet |
Suppress console output during export. Follows the global
|
wasm_packages |
Download and include binary WebAssembly packages as
part of the output app's static assets. Defaults to |
package_cache |
Cache downloaded binary WebAssembly packages. Defaults
to |
assets_version |
The version of the Shinylive assets to use in the
exported app. Defaults to |
template_dir |
Path to a custom template directory to use when exporting
the shinylive app. The template can be copied from the shinylive assets
using: |
template_params |
A list of parameters to pass to the template. The
supported parameters depends on the template being used. Custom templates
may support additional parameters (see With shinylive assets > 0.4.1, the default export template supports the following parameters:
|
verbose |
Deprecated, please use |
Value
Nothing. The app is exported to destdir
. Instructions for serving
the directory are printed to stdout.
Examples
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)
}