mirror of
https://git.dirksys.ovh/dirk/bankserver.git
synced 2025-12-20 11:09:21 +01:00
21 lines
455 B
Rust
21 lines
455 B
Rust
use std::sync::Arc;
|
|
|
|
use axum::{Router, routing::get};
|
|
use bank_core::meta::{Bank, Motd};
|
|
|
|
use super::{AppState, EState, Json, State};
|
|
|
|
pub fn router() -> Router<Arc<AppState>> {
|
|
Router::new()
|
|
.route("/motd", get(motd))
|
|
.route("/bank", get(bank))
|
|
}
|
|
|
|
pub async fn motd(EState(state): State) -> Json<Motd> {
|
|
Json(state.meta.motd.clone())
|
|
}
|
|
|
|
pub async fn bank(EState(state): State) -> Json<Bank> {
|
|
Json(state.meta.bank.clone())
|
|
}
|