Using axum 0.8 now

This commit is contained in:
Martin Brodbeck 2025-01-07 11:15:23 +01:00
parent 3b4e61ac14
commit 76c938f1bf
3 changed files with 448 additions and 245 deletions

679
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,12 @@
[package] [package]
name = "kosyncrs" name = "kosyncrs"
version = "1.0.1" version = "1.1.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
axum = "0.6.20" axum = "0.8.1"
redis = { version = "0.23.3", features = ["tokio-comp"] } redis = { version = "0.23.3", features = ["tokio-comp"] }
serde = { version = "1.0.188", features = ["derive"] } serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107" serde_json = "1.0.107"

View file

@ -41,14 +41,12 @@ async fn main() {
.route("/users/create", post(create_user)) .route("/users/create", post(create_user))
.route("/users/auth", get(auth_user)) .route("/users/auth", get(auth_user))
.route("/syncs/progress", put(update_progress)) .route("/syncs/progress", put(update_progress))
.route("/syncs/progress/:document", get(get_progress)) .route("/syncs/progress/{documenti}", get(get_progress))
.route("/healthcheck", get(healthcheck)); .route("/healthcheck", get(healthcheck));
// run it with hyper on localhost:3000 // run it with hyper on localhost:3003
axum::Server::bind(&"127.0.0.1:3003".parse().unwrap()) let listener = tokio::net::TcpListener::bind("127.0.0.1:3003").await.unwrap();
.serve(app.into_make_service()) axum::serve(listener, app).await.unwrap();
.await
.unwrap();
} }
async fn root() -> &'static str { async fn root() -> &'static str {