Skip to content

Commit

Permalink
update axum to 0.7.1 in examples/axum
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarshkukreti committed Nov 30, 2023
1 parent 12d9ff8 commit c1dc693
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false

[dependencies]
axum = "0.6.20"
axum = "0.7.1"
markup = { path = "../../markup" }
serde = { version = "1.0.192", features = ["derive"] }
tokio = { version = "1.34.0", features = ["full"] }
11 changes: 6 additions & 5 deletions examples/axum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ async fn post(form: axum::extract::Form<Contact>) -> impl axum::response::IntoRe
async fn main() {
let app = axum::Router::new().route("/", axum::routing::get(get).post(post));

eprintln!("starting on http://0.0.0.0:3000");
let address = "0.0.0.0:3000";

axum::Server::bind(&([0, 0, 0, 0], 3000).into())
.serve(app.into_make_service())
.await
.unwrap();
eprintln!("starting on http://{}", address);

let listener = tokio::net::TcpListener::bind(address).await.unwrap();

axum::serve(listener, app).await.unwrap();
}

0 comments on commit c1dc693

Please sign in to comment.