update examples

This commit is contained in:
2026-05-27 01:43:59 -04:00
parent bcb5c31c31
commit 1ce2c25431
2 changed files with 3 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
# axum-app-wrapper
A small plugin layer for `axum` applications, inspired by [fastify](https://fastify.dev/) from the Node/JS ecosystem.
A small plugin layer for `axum` applications, inspired by [fastify](https://fastify.dev/) from the Node/JS ecosystem and the [rocket](https://rocket.rs/) framework.
Plugins can:

View File

@@ -43,7 +43,7 @@ async fn main() -> anyhow::Result<()> {
let metrics_registry = Arc::new(Metrics::new());
// Create your plugins using AdHocPlugin
let config_plugin = AdHocPlugin::<AppState>::new()
let config_plugin = AdHocPlugin::<AppState>::named("Config")
.on_init(async |mut state| {
state.insert(config);
Ok(state)
@@ -53,7 +53,7 @@ async fn main() -> anyhow::Result<()> {
Ok(router.route("/health", get(health)))
});
let metrics_plugin = AdHocPlugin::<AppState>::new()
let metrics_plugin = AdHocPlugin::<AppState>::named("Metrics")
.on_init(async |mut state| {
state.insert(metrics_registry);
Ok(state)