rebuild file structur + simple sqlite db endpoint
This commit is contained in:
33
src/main.rs
33
src/main.rs
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user