Multiple file routing setup
This commit is contained in:
26
src/main.rs
Normal file
26
src/main.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
use axum::{
|
||||
//response::Html,
|
||||
routing::get, //post,
|
||||
Router
|
||||
};
|
||||
|
||||
mod routes;
|
||||
|
||||
#[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 handler() -> &'static str {
|
||||
"Hiii from localhost"
|
||||
}
|
||||
Reference in New Issue
Block a user