diff --git a/examples/axum_example/.env b/examples/axum_example/.env index 375cab79..406a6e89 100644 --- a/examples/axum_example/.env +++ b/examples/axum_example/.env @@ -1,3 +1,3 @@ HOST=127.0.0.1 PORT=8000 -DATABASE_URL="postgres://root:root@localhost/axum_exmaple" \ No newline at end of file +DATABASE_URL="postgres://root:root@localhost/axum_example" \ No newline at end of file diff --git a/examples/axum_example/Cargo.toml b/examples/axum_example/Cargo.toml index 3e81d995..ffcd167c 100644 --- a/examples/axum_example/Cargo.toml +++ b/examples/axum_example/Cargo.toml @@ -10,16 +10,16 @@ publish = false members = [".", "entity", "migration"] [dependencies] -tokio = { version = "1.14", features = ["full"] } -axum = { version = "0.4.2" } -tower = "0.4.11" -tower-http = { version = "0.2", features = ["fs"] } -tower-cookies = { version = "0.4" } -anyhow = "1" -dotenv = "0.15" -serde = "1" -serde_json = "1" -tera = "1" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } +tokio = { version = "1.18.1", features = ["full"] } +axum = "0.5.4" +tower = "0.4.12" +tower-http = { version = "0.3.3", features = ["fs"] } +tower-cookies = "0.6.0" +anyhow = "1.0.57" +dotenv = "0.15.0" +serde = "1.0.137" +serde_json = "1.0.81" +tera = "1.15.0" +tracing-subscriber = { version = "0.3.11", features = ["env-filter"] } entity = { path = "entity" } migration = { path = "migration" } diff --git a/examples/axum_example/src/main.rs b/examples/axum_example/src/main.rs index 35b07976..9875ab8b 100644 --- a/examples/axum_example/src/main.rs +++ b/examples/axum_example/src/main.rs @@ -5,7 +5,7 @@ use axum::{ http::StatusCode, response::Html, routing::{get, get_service, post}, - AddExtensionLayer, Router, Server, + Router, Server, }; use entity::post; use entity::sea_orm; @@ -61,8 +61,8 @@ async fn main() -> anyhow::Result<()> { .layer( ServiceBuilder::new() .layer(CookieManagerLayer::new()) - .layer(AddExtensionLayer::new(conn)) - .layer(AddExtensionLayer::new(templates)), + .layer(Extension(conn)) + .layer(Extension(templates)), ); let addr = SocketAddr::from_str(&server_url).unwrap();