Skip to content

Commit

Permalink
Update to axum 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonbaeten committed Dec 4, 2023
1 parent b500dfb commit e46d4bd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.3.0"
version = "0.4.0"
edition = "2021"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/tweedegolf/memory-serve"
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ async fn main() {
.merge(memory_router);

let addr = SocketAddr::from(([127, 0, 0, 1], 3000));

info!("listening on {}", addr);
axum::Server::bind(&addr)
.serve(app.into_make_service())
.await
.unwrap();
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
axum::serve(listener, app).await.unwrap();
}
```

Expand Down
2 changes: 1 addition & 1 deletion examples/test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false

[dependencies]
memory-serve = { path = "../../memory-serve" }
axum = "0.6"
axum = "0.7"
tokio = { version = "1.0", features = ["full"] }
tracing-subscriber = "0.3"
tracing = "0.1"
6 changes: 2 additions & 4 deletions examples/test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ async fn main() {
.route("/hello", get(handler));

let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();

info!("listening on {}", addr);
axum::Server::bind(&addr)
.serve(app.into_make_service())
.await
.unwrap();
axum::serve(listener, app).await.unwrap();
}

async fn handler() -> Html<&'static str> {
Expand Down
4 changes: 2 additions & 2 deletions memory-serve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description.workspace = true
[dependencies]
brotli = "3.4"
flate2 = "1.0"
axum = { version = "0.6", default-features = false }
memory-serve-macros = { version = "0.3", path = "../memory-serve-macros" }
axum = { version = "0.7", default-features = false }
memory-serve-macros = { version = "0.4", path = "../memory-serve-macros" }
tracing = "0.1"
sha256 = "1.4"

Expand Down
7 changes: 2 additions & 5 deletions memory-serve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@
//! .merge(memory_router);
//!
//! let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
//!
//! axum::Server::bind(&addr)
//! .serve(app.into_make_service())
//! .await
//! .unwrap();
//! let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
//! axum::serve(listener, app).await.unwrap();
//! }
//! ```
//!
Expand Down

0 comments on commit e46d4bd

Please sign in to comment.