aboutsummaryrefslogtreecommitdiff
path: root/src/routers
diff options
context:
space:
mode:
Diffstat (limited to 'src/routers')
-rw-r--r--src/routers/account.rs21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/routers/account.rs b/src/routers/account.rs
index e8c9753..8192133 100644
--- a/src/routers/account.rs
+++ b/src/routers/account.rs
@@ -2,16 +2,23 @@ use axum::Router;
2use axum::response::IntoResponse; 2use axum::response::IntoResponse;
3use axum::routing::{get, post}; 3use axum::routing::{get, post};
4 4
5pub(crate) fn router() -> Router { 5use crate::response::ApiResponse;
6 Router::new()
7 .route("/me", get(me))
8 .route("/login", post(login))
9}
10 6
11async fn me() -> impl IntoResponse { 7async fn me() -> impl IntoResponse {
12 "Me" 8 ApiResponse::Success("Me")
9}
10
11async fn register() -> impl IntoResponse {
12 ApiResponse::Success("Register")
13} 13}
14 14
15async fn login() -> impl IntoResponse { 15async fn login() -> impl IntoResponse {
16 "Login" 16 ApiResponse::Success("Login")
17}
18
19pub(crate) fn router() -> Router {
20 Router::new()
21 .route("/me", get(me))
22 .route("/register", post(register))
23 .route("/login", post(login))
17} 24}