mod.rs
⎇
Raw
1use std::sync::Arc;
2
3use axum::routing::{get, post};
4use axum::Router;
5
6use crate::error::AppState;
7
8mod auth;
9mod spa;
10
11pub fn router(state: Arc<AppState>) -> Router {
12 Router::new()
13 .route("/api/auth/login", post(auth::login))
14 .route("/api/auth/logout", post(auth::logout))
15 .route("/api/auth/me", get(auth::me))
16 .route("/api/auth/setup", post(auth::setup))
17 .fallback(spa::fallback)
18 .with_state(state)
19}
20