Skip to main content

Module app

Module app 

Source
Expand description

The App builder.

An App is a description of an application: routes, mounted child apps, state, middleware and lifespan hooks. Nothing is materialised until App::run or App::into_router_service, which validate the whole configuration first and report problems as ServerError::Configuration instead of panicking.

§Mounted applications

app.mount("/api/v1", child) keeps the child’s state and middleware scoped to the child’s routes. Child routes are merged into the root OpenAPI document with the prefix prepended; child docs settings are ignored. Child lifespan hooks are lifted into the parent (child hooks run after the parent’s at startup, before them at shutdown).

Structs§

App
An HTTP application: routes, state, middleware, lifespan and metadata.
AppMeta
Application metadata used for OpenAPI generation.
DocsConfig
Where the generated documentation is served. None disables an endpoint.