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:
parent
70bfb11e46
commit
40c6ed2c44
1 changed files with 2 additions and 2 deletions
|
@ -73,8 +73,8 @@ async fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/votes/submit/:slug", post(leaderboard_submit_score))
|
.route("/votes/:slug", post(leaderboard_submit_score))
|
||||||
.route("/votes/view/:slug", get(view_votes))
|
.route("/votes/:slug", get(view_votes))
|
||||||
.with_state(initial_state.clone());
|
.with_state(initial_state.clone());
|
||||||
|
|
||||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
||||||
|
|
Loading…
Add table
Reference in a new issue