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

@@ -1,24 +1,23 @@
use axum::{
//response::Html,
routing::get, //post,
Router
};
use axum::serve;
use tokio::net::TcpListener;
mod utils;
mod routes;
mod rooms;
use crate::utils::db_pool::HotelPools;
use routes::create_router;
#[tokio::main]
async fn main() {
let app : Router = routes::create_routes();
let listener = tokio::net::TcpListener::bind("127.0.0.1:3000")
.await
.unwrap();
println!("listining on {}", listener.local_addr().unwrap() );
axum::serve(listener, app).await.unwrap();
async fn main() -> std::io::Result<()> {
let hotel_pools = HotelPools::new();
let app = create_router(hotel_pools);
let listener = TcpListener::bind("0.0.0.0:3000").await?;
serve(listener, app).into_future().await?;
Ok(())
}
async fn handler() -> &'static str {