Add service layer to abstract business logic

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-08-22 12:28:36 +02:00
parent 208d18c280
commit f30706a25a
4 changed files with 140 additions and 30 deletions

View File

@@ -82,8 +82,11 @@ async fn main() {
.await
.expect("Failed to connect to Redis");
// Initialize Service
let service = herocoordinator::service::AppService::new(redis);
// Shared application state
let state = Arc::new(herocoordinator::rpc::AppState::new(redis));
let state = Arc::new(herocoordinator::rpc::AppState::new(service));
// Build RPC modules for both servers
let http_module = herocoordinator::rpc::build_module(state.clone());