Move the voting API under one route

Instead of /submit and /view, it's either a GET or POST request against
/votes/:slug.
This commit is contained in:
Joshua Goins 2025-01-18 13:30:53 -05:00
parent 70bfb11e46
commit 40c6ed2c44

View file

@ -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));