~repos /rust-embed
git clone https://pyrossh.dev/repos/rust-embed.git
rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
5fe13a57
—
Markus Kohlhase 1 year ago
Update axum to v0.7
- Cargo.toml +1 -1
- examples/axum.rs +2 -1
Cargo.toml
CHANGED
|
@@ -74,7 +74,7 @@ hex = { version = "0.4.3", optional = true }
|
|
|
74
74
|
tokio = { version = "1.0", optional = true, features = ["macros", "rt-multi-thread"] }
|
|
75
75
|
warp = { version = "0.3", default-features = false, optional = true }
|
|
76
76
|
rocket = { version = "0.5.0-rc.2", default-features = false, optional = true }
|
|
77
|
-
axum = { version = "0.
|
|
77
|
+
axum = { version = "0.7", default-features = false, features = ["http1", "tokio"], optional = true }
|
|
78
78
|
poem = { version = "1.3.30", default-features = false, features = ["server"], optional = true }
|
|
79
79
|
salvo = { version = "0.16", default-features = false, optional = true }
|
|
80
80
|
|
examples/axum.rs
CHANGED
|
@@ -18,7 +18,8 @@ async fn main() {
|
|
|
18
18
|
// Start listening on the given address.
|
|
19
19
|
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
|
20
20
|
println!("listening on {}", addr);
|
|
21
|
+
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
|
|
21
|
-
axum::
|
|
22
|
+
axum::serve(listener, app.into_make_service()).await.unwrap();
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
// We use static route matchers ("/" and "/index.html") to serve our home
|