Compare commits

..

2 Commits

Author SHA1 Message Date
5b0592f51d Moved router code to its own function (#12)
All checks were successful
Release Tagging / release (push) Successful in 34s
Rust Build / Check (push) Successful in 46s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Check (pull_request) Successful in 49s
Rust Build / Test Suite (pull_request) Successful in 58s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Test Suite (push) Successful in 51s
Rust Build / Clippy (push) Successful in 46s
Rust Build / build (push) Successful in 1m9s
Rust Build / Clippy (pull_request) Successful in 43s
Rust Build / build (pull_request) Successful in 1m14s
Reviewed-on: #12
2025-04-03 16:31:54 +00:00
KD
79f6ebdc09 Moved router code to its own function
Some checks failed
Rust Build / Check (pull_request) Successful in 53s
Rust Build / Test Suite (pull_request) Failing after 58s
Rust Build / Rustfmt (pull_request) Successful in 28s
Rust Build / Clippy (pull_request) Successful in 57s
Rust Build / build (pull_request) Successful in 1m21s
2025-04-03 12:25:01 -04:00

View File

@@ -21,11 +21,7 @@ async fn main() {
axum::serve(listener, app).await.unwrap(); axum::serve(listener, app).await.unwrap();
} }
async fn app() -> Router { async fn routes() -> Router {
let pool = icarus_auth::db_pool::create_pool()
.await
.expect("Failed to create pool");
// build our application with a route // build our application with a route
Router::new() Router::new()
.route(callers::endpoints::DBTEST, get(callers::common::db_ping)) .route(callers::endpoints::DBTEST, get(callers::common::db_ping))
@@ -34,7 +30,14 @@ async fn app() -> Router {
callers::endpoints::REGISTER, callers::endpoints::REGISTER,
post(callers::register::register_user), post(callers::register::register_user),
) )
.layer(axum::Extension(pool)) }
async fn app() -> Router {
let pool = icarus_auth::db_pool::create_pool()
.await
.expect("Failed to create pool");
routes().await.layer(axum::Extension(pool))
} }
#[cfg(test)] #[cfg(test)]