Skip to main content

app_routes

Macro app_routes 

Source
app_routes!() { /* proc-macro */ }
Expand description

Declares the application’s URL blueprint and generates its init().

Takes an optional deps( … ) { … } block — constructor-injected services and let-bindings shared across controllers — and a routes { mount => Controller … } map. Expands to an async init(…) returning the built Router: it constructs every controller, wires its dependencies, and registers each mount. An optional families { … } block makes caller declarations a compile-time requirement under listed prefixes, and an optional hosts { … } block registers host aliases — checked when init() runs, which returns the error for a bad entry. See the actus crate’s top-level docs for worked examples.