rebuild file structur + simple sqlite db endpoint

This commit is contained in:
2025-09-04 22:32:53 +02:00
parent 3db51cc805
commit 3450c216c0
20 changed files with 748 additions and 49 deletions

View File

@@ -2,11 +2,23 @@ use axum::{
Router,
};
pub mod rooms;
pub mod inventory;
use crate::rooms::routes::rooms_routes;
pub fn create_routes() -> Router {
pub mod inventory;
use crate::utils::db_pool::HotelPools;
pub fn create_router(hotel_pools: HotelPools) -> Router {
Router::new()
.nest("/inventory", inventory::inventory_routes())
.nest("/rooms", rooms::rooms_routes())
}
.nest("/rooms", rooms_routes())
.with_state(hotel_pools) // 👈 hotel_db is passed in as argument
}
/*
pub fn create_router() -> Router {
Router::new()
.nest("/rooms", rooms_routes())
//.nest("/inventory", inventory::inventory_routes)
}
*/

View File

@@ -1,15 +0,0 @@
use axum::{
routing::{get, //post
},
Router,
};
pub fn rooms_routes() -> Router {
Router::new()
.route("/", get(hi_rooms) )
}
async fn hi_rooms() -> &'static str {
"Hiii from room.rs route module"
}