add: postgres support
chore: restructure
This commit is contained in:
parent
cda879f6df
commit
b6fe2fba37
58 changed files with 3403 additions and 603 deletions
28
crates/app/src/routes/api/v1/mod.rs
Normal file
28
crates/app/src/routes/api/v1/mod.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
pub mod auth;
|
||||
use axum::{
|
||||
Router,
|
||||
routing::{get, post},
|
||||
};
|
||||
use serde::Deserialize;
|
||||
|
||||
pub fn routes() -> Router {
|
||||
Router::new()
|
||||
// global
|
||||
.route("/auth/register", post(auth::register_request))
|
||||
.route("/auth/login", post(auth::login_request))
|
||||
// profile
|
||||
.route(
|
||||
"/auth/profile/{id}/avatar",
|
||||
get(auth::images::avatar_request),
|
||||
)
|
||||
.route(
|
||||
"/auth/profile/{id}/banner",
|
||||
get(auth::images::banner_request),
|
||||
)
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct AuthProps {
|
||||
pub username: String,
|
||||
pub password: String,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue