-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
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?;
Metadata
Metadata
Assignees
Labels
No labels