Files
unshell/unshell-server/src/main.rs
T

23 lines
476 B
Rust
Raw Normal View History

2025-11-29 13:15:09 -07:00
use axum;
use tokio::net::TcpListener;
use unshell_lib::info;
2025-11-28 18:39:14 -07:00
2025-11-29 13:15:09 -07:00
use unshell_server::app;
2025-11-28 18:39:14 -07:00
#[tokio::main]
async fn main() {
2025-11-29 13:15:09 -07:00
unshell_lib::logger::PrettyLogger::init();
2025-11-28 18:39:14 -07:00
2025-11-29 13:15:09 -07:00
let listener = TcpListener::bind("127.0.0.1:3000")
2025-11-28 18:39:14 -07:00
.await
2025-11-29 13:15:09 -07:00
.expect("Unable to start listener");
2025-11-28 18:39:14 -07:00
2025-11-29 13:15:09 -07:00
info!("Listening on {}", listener.local_addr().unwrap());
2025-11-28 18:39:14 -07:00
2025-11-29 13:15:09 -07:00
let app = app::app().await;
2025-11-28 18:39:14 -07:00
2025-11-29 13:15:09 -07:00
axum::serve(listener, app)
.await
.expect("Error serving application");
2025-11-28 18:39:14 -07:00
}