Multiple file routing setup

This commit is contained in:
2025-08-18 08:16:50 +02:00
parent 82a7a5acb5
commit 3db51cc805
7 changed files with 782 additions and 0 deletions

15
src/routes/inventory.rs Normal file
View File

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

12
src/routes/mod.rs Normal file
View File

@@ -0,0 +1,12 @@
use axum::{
Router,
};
pub mod rooms;
pub mod inventory;
pub fn create_routes() -> Router {
Router::new()
.nest("/inventory", inventory::inventory_routes())
.nest("/rooms", rooms::rooms_routes())
}

15
src/routes/rooms.rs Normal file
View File

@@ -0,0 +1,15 @@
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"
}