From 40c6ed2c4479b9222fac2057ca9c076a428c910f Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 18 Jan 2025 13:30:53 -0500 Subject: [PATCH] Move the voting API under one route Instead of /submit and /view, it's either a GET or POST request against /votes/:slug. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 742e8da..6b4502c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,8 +73,8 @@ async fn main() { }; let app = Router::new() - .route("/votes/submit/:slug", post(leaderboard_submit_score)) - .route("/votes/view/:slug", get(view_votes)) + .route("/votes/:slug", post(leaderboard_submit_score)) + .route("/votes/:slug", get(view_votes)) .with_state(initial_state.clone()); let addr = SocketAddr::from(([127, 0, 0, 1], 3000));