feat: add environment configuration for database and authentication, update router setup

This commit is contained in:
2025-09-06 01:55:59 +02:00
parent 3dd6c0f64b
commit 6e63dca513
12 changed files with 36 additions and 18 deletions

View File

@@ -13,10 +13,17 @@ pub struct TestApp {
}
pub async fn setup() -> TestApp {
std::env::set_var("DATABASE_URL", "sqlite::memory:");
std::env::set_var("AUTH_SECRET", "test_secret");
std::env::set_var("BASE_URL", "http://localhost:3000");
std::env::set_var("HOST", "localhost");
std::env::set_var("PORT", "3000");
std::env::set_var("LOG_LEVEL", "debug");
let db = setup_test_db("sqlite::memory:")
.await
.expect("Failed to set up test db");
let router = setup_router(db.clone());
let router = setup_router(db.clone(), &app::config::Config::from_env());
TestApp { router, db }
}