simple Log In endpoint without encryption
This commit is contained in:
@@ -1,24 +1,26 @@
|
||||
use axum::{
|
||||
Router,
|
||||
};
|
||||
use r2d2_sqlite::SqliteConnectionManager;
|
||||
use r2d2::{Pool};
|
||||
|
||||
use crate::rooms::routes::rooms_routes;
|
||||
use crate::utils::routes::utils_routes;
|
||||
|
||||
pub mod inventory;
|
||||
use crate::utils::db_pool::HotelPools;
|
||||
use crate::utils::db_pool::{AppState};
|
||||
|
||||
//TODO: add secret fomr dotenv here
|
||||
|
||||
|
||||
|
||||
pub fn create_router(state: AppState) -> Router {
|
||||
|
||||
pub fn create_router(hotel_pools: HotelPools) -> Router {
|
||||
Router::new()
|
||||
.nest("/rooms", rooms_routes())
|
||||
.with_state(hotel_pools) // 👈 hotel_db is passed in as argument
|
||||
|
||||
.nest("/auth", utils_routes())
|
||||
.with_state(state) // 👈 hotel_db is passed in as argument
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
pub fn create_router() -> Router {
|
||||
Router::new()
|
||||
.nest("/rooms", rooms_routes())
|
||||
//.nest("/inventory", inventory::inventory_routes)
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user