Quick start
This example registers one singleton provider, one controller, and one GET route with a path parameter. It only uses default features.
1. Add dependencies
2. Declare a provider and controller
#[injectable] generates a FromModuleRef implementation for an ordinary Rust type. The Arc<GreetingService> field on GreetingController becomes an explicit dependency. The module registers the controller as both a provider and an HTTP controller.
3. Run and call the route
In another terminal:
The response body is:
What happened during construction
BootFactory::createcollected theAppModuledeclarations.- The container checked provider tokens, dependencies, and module visibility.
- Controller macros generated
ControllerDefinitionandRouteDefinitionvalues. - The Axum adapter converted framework routes into a concrete router.
- The request entered the Boot pipeline, the path parameter became a
String, and the handler ran.
Missing dependencies, duplicate routes, and invalid module graphs return a BootError before the server listens.
The explicit API remains available
Attribute macros are not a second runtime. Dynamic applications and projects that avoid procedural macros can implement Module directly and return ProviderDefinition and ControllerDefinition values. Both styles enter the same application graph and execution pipeline.
Next steps
- Split modules, export providers, and choose scopes in the application model.
- Learn extraction, versioning, and response types in controllers and routing.
- Add authentication, transformation, and unified error handling in the request pipeline.