Skip to content

Commit

Permalink
Update to axum-0.7/hyper-1.2
Browse files Browse the repository at this point in the history
Hyper (and by extension axum) remove the `Server` struct on 1.0, this
largely keeps the same API but uses axum::serve under the hood.
However bind is now an async function, and the errors are slightly
different.
  • Loading branch information
RaoulHC committed Mar 24, 2024
1 parent 0c128c0 commit c4d97d9
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 142 deletions.
175 changes: 104 additions & 71 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion matchbox_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ matchbox_protocol = { version = "0.9", path = "../matchbox_protocol", features =
"json",
] }
async-trait = "0.1"
axum = { version = "0.6", features = ["ws"] }
axum = { version = "0.7", features = ["ws"] }
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower-http = { version = "0.4", features = ["cors", "trace"] }
Expand Down
5 changes: 1 addition & 4 deletions matchbox_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ async fn main() {
})
.cors()
.trace()
.mutate_router(|router| {
// Apply router transformations
router.route("/health", get(|| async { StatusCode::OK }))
})
.mutate_router(|router| router.route("/health", get(health_handler)))
.build();
server
.serve()
Expand Down
Loading

0 comments on commit c4d97d9

Please sign in to comment.