You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code/videos related to Axum, it's used 0.6.* but >0.7 has a breaking change..
cargo add axum -F multipart.
// Build Axum with an "extension" to hold the database connection pool
let app = Router::new()
.route("/", get(test))
.layer(Extension(pool));
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
axum::Server::bind(&addr)
.serve(app.into_make_service())
.await
.unwrap();
to:
let app = Router::new()
.route("/", get(test))
.layer(Extension(pool));
let listener = TcpListener::bind("127.0.0.1:3000").await?;
axum::serve(listener, app).await?;
The text was updated successfully, but these errors were encountered:
In the code/videos related to Axum, it's used 0.6.* but >0.7 has a breaking change..
cargo add axum -F multipart
.to:
The text was updated successfully, but these errors were encountered: