diff options
author | rtkay123 <dev@kanjala.com> | 2025-07-23 13:39:40 +0200 |
---|---|---|
committer | rtkay123 <dev@kanjala.com> | 2025-07-23 13:39:40 +0200 |
commit | 089efa225cc0a4e7be12608129ddbff28d11f320 (patch) | |
tree | d5d27ba5f5056c7a539365fd314e6d7ce7529523 /crates/auth/src/server.rs | |
parent | 0a48abb0f0d4752b639fb89dd2db32a3db0eebb8 (diff) | |
download | sellershut-089efa225cc0a4e7be12608129ddbff28d11f320.tar.bz2 sellershut-089efa225cc0a4e7be12608129ddbff28d11f320.zip |
feat(auth): discord oauth
Diffstat (limited to 'crates/auth/src/server.rs')
-rw-r--r-- | crates/auth/src/server.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/auth/src/server.rs b/crates/auth/src/server.rs new file mode 100644 index 0000000..3cfac60 --- /dev/null +++ b/crates/auth/src/server.rs @@ -0,0 +1,28 @@ +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::<Configuration>().unwrap() +} |