diff --git a/backend/public/Cargo.lock b/backend/public/Cargo.lock index 51f31a9..938de3d 100644 --- a/backend/public/Cargo.lock +++ b/backend/public/Cargo.lock @@ -104,7 +104,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.4.4", "bytes", "futures-util", "http", @@ -113,7 +113,7 @@ dependencies = [ "hyper", "hyper-util", "itoa", - "matchit", + "matchit 0.7.3", "memchr", "mime", "percent-encoding", @@ -123,9 +123,43 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", - "tower 0.5.1", + "tower 0.5.2", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" +dependencies = [ + "axum-core 0.5.2", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit 0.8.4", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower 0.5.2", "tower-layer", "tower-service", "tracing", @@ -146,7 +180,27 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.1", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", "tower-layer", "tower-service", "tracing", @@ -901,9 +955,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libm" @@ -959,6 +1013,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "md-5" version = "0.10.6" @@ -1251,7 +1311,7 @@ dependencies = [ name = "public" version = "0.1.0" dependencies = [ - "axum", + "axum 0.8.4", "chrono", "dotenvy", "fred", @@ -1920,12 +1980,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.1" @@ -1992,9 +2046,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", @@ -2010,9 +2064,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", @@ -2061,14 +2115,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 0.1.2", + "sync_wrapper", "tokio", "tower-layer", "tower-service", @@ -2109,7 +2163,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "313fa625fea5790ed56360a30ea980e41229cf482b4835801a67ef1922bf63b9" dependencies = [ - "axum", + "axum 0.7.6", "forwarded-header-value", "governor", "http", diff --git a/backend/public/Cargo.toml b/backend/public/Cargo.toml index b626412..bbbacbf 100644 --- a/backend/public/Cargo.toml +++ b/backend/public/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Wyatt J. Miller axum::Router { axum::Router::new() - .route("/", get(AuthorsRoute::get_all)) - .route("/:id", get(AuthorsRoute::get_one)) - .route("/:id/posts", get(AuthorsRoute::get_authors_posts)) + .route("/authors", get(AuthorsRoute::get_all)) + .route("/authors/{id}", get(AuthorsRoute::get_one)) + .route("/authors/{id}/posts", get(AuthorsRoute::get_authors_posts)) .with_state(app_state.clone()) } diff --git a/backend/public/src/routes/comments.rs b/backend/public/src/routes/comments.rs index a8a1ab1..c75921d 100644 --- a/backend/public/src/routes/comments.rs +++ b/backend/public/src/routes/comments.rs @@ -43,9 +43,9 @@ impl CommentsRoute { pub fn routes(app_state: &AppState) -> axum::Router { // add more comment routes here! axum::Router::new() - .route("/post/:id", get(CommentsRoute::get_post_comments)) - .route("/add", post(CommentsRoute::insert_comment)) - .route("/index", get(CommentsRoute::get_comments_index)) + .route("/comments/post/{id}", get(CommentsRoute::get_post_comments)) + .route("/comments/add", post(CommentsRoute::insert_comment)) + .route("/comments/index", get(CommentsRoute::get_comments_index)) .with_state(app_state.clone()) } diff --git a/backend/public/src/routes/posts.rs b/backend/public/src/routes/posts.rs index 30c1e83..e11af84 100644 --- a/backend/public/src/routes/posts.rs +++ b/backend/public/src/routes/posts.rs @@ -57,14 +57,14 @@ impl PostsRoute { pub fn routes(app_state: &AppState) -> Router { // add more post routes here! Router::new() - .route("/all", get(PostsRoute::get_all)) - .route("/:id", get(PostsRoute::get_one)) - .route("/recent", get(PostsRoute::get_recent_posts)) - .route("/popular", get(PostsRoute::get_popular_posts)) - .route("/hot", get(PostsRoute::get_hot_posts)) - .route("/featured", get(PostsRoute::get_featured_posts)) - .route("/rss", get(PostsRoute::get_rss_posts)) - .route("/sitemap", get(PostsRoute::get_sitemap)) + .route("/posts/all", get(PostsRoute::get_all)) + .route("/posts/{id}", get(PostsRoute::get_one)) + .route("/posts/recent", get(PostsRoute::get_recent_posts)) + .route("/posts/popular", get(PostsRoute::get_popular_posts)) + .route("/posts/hot", get(PostsRoute::get_hot_posts)) + .route("/posts/featured", get(PostsRoute::get_featured_posts)) + .route("/posts/rss", get(PostsRoute::get_rss_posts)) + .route("/posts/sitemap", get(PostsRoute::get_sitemap)) .with_state(app_state.clone()) } diff --git a/backend/public/src/routes/projects.rs b/backend/public/src/routes/projects.rs index 74dbcd6..a8ca6ec 100644 --- a/backend/public/src/routes/projects.rs +++ b/backend/public/src/routes/projects.rs @@ -21,7 +21,7 @@ pub struct ProjectsRoute; impl ProjectsRoute { pub fn routes(app_state: &AppState) -> Router { Router::new() - .route("/", get(ProjectsRoute::get_all)) + .route("/projects", get(ProjectsRoute::get_all)) .with_state(app_state.clone()) }