Convention-based assembly: builds the UI (optional), sources helpers/*.R,
parses every routers/*.R into a plumber2 API, and serves the www/
directory at /. No _aurora.yml is required; an optional manifest only
overrides a few keys.
Usage
aurora_app(
dir = ".",
rebuild_ui = TRUE,
host = "127.0.0.1",
port = 8000L,
otel = NULL,
verbose = NULL,
attach = NULL
)Arguments
- dir
App directory (canonical aurora layout).
- rebuild_ui
Whether to rebuild the static UI before assembling.
- host, port
Bind address/port baked into the API object. Usually overridden by
aurora_run().- otel
Wire OpenTelemetry logging (
api_logger(logger_otel())) so logs join plumber2's automatic request spans and metrics.NULL(default) resolves from_aurora.yml(otel:) then theAURORA_OTELenvironment variable, falling back toFALSE. Wiring is a no-op until the otel package is enabled in the environment, so it is safe to leave on.- verbose
Emit a per-step cli log (one line per sourced helper / parsed router, otel wiring).
NULL(default) resolves fromoptions(aurora.verbose)then theAURORA_VERBOSEenv var, falling back toFALSE(quiet: a single assembly-summary line). Errors and warnings always print.- attach
Attach the runtime packages declared in
_aurora.yml(packages:) before sourcing helpers, so helpers and handlers can use their functions unqualified (mirrors a plumber-v1library()block).NULL(default) resolves from_aurora.yml(attach:) thenAURORA_ATTACH, falling back toFALSE. Off by default to keep assembly thin; thepackages:list is the runtime set (noshiny/bslib), so it is safe to enable. See ADR-012.
Details
Extra static mounts can be declared in _aurora.yml under statics: – a map
of URL prefix to directory, served at that prefix (in addition to www/ at
/). This is for assets shared across apps from a server-side directory
mounted as a volume; e.g. statics: then /assets: /srv/shared serves
/srv/shared/logo.png at /assets/logo.png. Relative paths resolve against
the app root; a missing directory (e.g. an unmounted volume) is skipped with
a warning so the app still starts. See ADR-018.
Each handler's URL is taken verbatim from its #* @get /... annotation, so
the route prefix is embedded by aurora_add_route() at scaffold time – there
is no runtime path injection here.