-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring: migrate routes to separate modules (#14)
- Loading branch information
1 parent
2db3283
commit c271079
Showing
7 changed files
with
92 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use axum::{ | ||
routing::{get, post}, | ||
Router, | ||
}; | ||
|
||
use crate::handlers::auth_handlers::{ | ||
login_handler, new_password_handler, otp_handler, send_pass_reset_handler, signup_handler, | ||
}; | ||
|
||
pub fn auth_routes() -> Router { | ||
Router::new() | ||
.route("/login", post(login_handler)) | ||
.route("/signup", post(signup_handler)) | ||
.route("/sendpassreset", get(send_pass_reset_handler)) | ||
.route("/newpassword", get(new_password_handler)) | ||
.route("/otp", get(otp_handler)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use axum::{routing::get, Router}; | ||
|
||
use crate::handlers::tests_handlers::health_check; | ||
|
||
pub fn diagnostics_routes() -> Router { | ||
Router::new().route("/health_check", get(health_check)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use axum::{ | ||
routing::{get, post}, | ||
Router, | ||
}; | ||
|
||
use crate::handlers::crud_handlers::{ | ||
add_friend_handler, change_flag_handler, create_matched_handler, get_accepted_boys_handler, | ||
get_boys_handler, get_girl_request_handler, get_girls_handler, get_matched_handler, | ||
reject_handler, | ||
}; | ||
|
||
pub fn matchmaking_routes() -> Router { | ||
Router::new() | ||
.route("/getboys", get(get_boys_handler)) | ||
.route("/getacceptedboys", post(get_accepted_boys_handler)) | ||
.route("/getgirls", get(get_girls_handler)) | ||
.route("/getgirlrequests", post(get_girl_request_handler)) | ||
.route("/addfriend", post(add_friend_handler)) | ||
.route("/changeflag", post(change_flag_handler)) | ||
.route("/creatematch", post(create_matched_handler)) | ||
.route("/getmatched", post(get_matched_handler)) | ||
.route("/reject", post(reject_handler)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
mod auth; | ||
mod diagnostics; | ||
mod matchmaking; | ||
mod score; | ||
mod user; | ||
|
||
pub use auth::*; | ||
pub use diagnostics::*; | ||
pub use matchmaking::*; | ||
pub use score::*; | ||
pub use user::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use axum::{routing::put, Router}; | ||
|
||
use crate::handlers::crud_handlers::{update_contest_score_handler, update_score_handler}; | ||
|
||
pub fn score_routes() -> Router { | ||
Router::new() | ||
.route("/updatescore", put(update_score_handler)) | ||
.route("/updatecontestscore", put(update_contest_score_handler)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use axum::{ | ||
routing::{get, post, put}, | ||
Router, | ||
}; | ||
|
||
use crate::handlers::crud_handlers::{ | ||
get_all_users_handler, get_user_by_id_handler, get_user_handler, update_user_character_handler, | ||
}; | ||
|
||
pub fn user_routes() -> Router { | ||
Router::new() | ||
.route("/getuser", post(get_user_handler)) | ||
.route("/getallusers", get(get_all_users_handler)) | ||
.route("/updatecharacter", put(update_user_character_handler)) | ||
.route("/getuserbyid", post(get_user_by_id_handler)) | ||
} |