implement basic patients routes

This commit is contained in:
Akhmedov Khadgimurad
2025-11-18 18:26:20 +03:00
parent 8e81b99f63
commit e7f20a4d82
15 changed files with 218 additions and 295 deletions

View File

@ -1,6 +1,16 @@
use test_exercise::router;
use hospital_server::app_state::AppState;
use hospital_server::router;
use sqlx::SqlitePool;
#[tokio::main]
async fn main() {
router().await;
let _ = dotenvy::dotenv();
let db_url = std::env::var("DATABASE_URL").expect("DATABASE_URL is not set");
let pool = SqlitePool::connect(&db_url)
.await
.expect("Cannot connect to db");
let state = AppState { pool: pool };
sqlx::migrate!().run(&state.pool).await.unwrap();
router(state).await;
}