Rebuilds the UI (optional), assembles the aurora_app() from convention, and
starts the plumber2 server. Development-time equivalent of
shiny::runApp(). The generated api.R calls this function, so local dev
and container entry share one assembly path.
Usage
aurora_run(
dir = ".",
port = 8000L,
host = "127.0.0.1",
rebuild_ui = NULL,
watch = FALSE,
watch_interval = 1,
otel = NULL,
verbose = NULL,
attach = NULL,
on_exit = NULL
)Arguments
- dir
App directory (canonical aurora layout).
- port
Port to bind.
- host
Host/interface to bind.
- rebuild_ui
Whether to rebuild the static UI before running.
NULL(default) resolves from theAURORA_REBUILD_UIenvironment variable (defaultTRUElocally). Containers set it toFALSE: the UI is compiled at build time and shipped aswww/index.html, so the runtime image serves it without the UI build dependencies (bslib, and transitively shiny).- watch
Live-reload for development. When
TRUE, aurora polls the UI source files (build_ui.Randui_modules/) and rebuilds the staticwww/index.htmlon change – refresh the browser to see it. Changes torouters//helpers/are detected but cannot be hot-swapped into a running server, so they log an advisory to restart. Requires the later package.- watch_interval
Polling interval in seconds when
watch = TRUE.- otel
Enable OpenTelemetry logging. Passed to
aurora_app();NULL(default) resolves from_aurora.ymlthen theAURORA_OTELenv var.- verbose
Per-step cli logging. Passed to
aurora_app();NULL(default) resolves fromoptions(aurora.verbose)thenAURORA_VERBOSE.- attach
Attach the
_aurora.ymlpackages:before sourcing helpers. Passed toaurora_app();NULL(default) resolves from_aurora.yml(attach:) thenAURORA_ATTACH. See ADR-012.- on_exit
Optional cleanup function
function()run when the server stops (registered on plumber2's"cleanup"lifecycle event). Use it to release resources opened in a helper – e.g.pool::poolClose(con_base)– replacing the v1pr_hook("exit", ...). Errors in the handler are reported but do not block shutdown.
Value
The result of plumber2::api_run(), invisibly.