use axum::{Router, routing::get}; use tower_http::trace::TraceLayer; use crate::{server::routes::health_check, state::AppHandle}; pub mod routes; pub fn router(state: AppHandle) -> Router { Router::new() .merge(routes::discord::discord_router(state.clone())) .route("/", get(health_check)) .route("/auth/authorised", get(health_check)) .layer(TraceLayer::new_for_http()) } #[cfg(test)] pub(crate) fn test_config() -> stack_up::Configuration { use stack_up::Configuration; let config_path = "auth.toml"; let config = config::Config::builder() .add_source(config::File::new(config_path, config::FileFormat::Toml)) .build() .unwrap(); config.try_deserialize::().unwrap() }