From 7665b6baede05671670c1c6ea235690c3778f52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kayn=C3=A3=20de=20Camargo?= Date: Wed, 1 May 2024 22:54:25 -0300 Subject: [PATCH] Feat: use app state correctly on routes --- src/config/router.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config/router.rs b/src/config/router.rs index b4cf32d..0a8f1c8 100644 --- a/src/config/router.rs +++ b/src/config/router.rs @@ -1,8 +1,10 @@ -use crate::{config::database, routes}; +use crate::routes; use axum::Router; +use super::app_state::app_state; + pub async fn initialize_routes() -> Router { - let app_state = database::connection().await; + let app_state = app_state().await; Router::new() .merge(routes::healthchecker::create_route()) .merge(routes::user::create_routes(app_state))