mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Move server stuff into API folder
This commit is contained in:
@@ -2,21 +2,11 @@ use axum;
|
||||
use tokio::net::TcpListener;
|
||||
use unshell_lib::info;
|
||||
|
||||
use unshell_server::app;
|
||||
use unshell_server::start_api;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
unshell_lib::logger::PrettyLogger::init();
|
||||
|
||||
let listener = TcpListener::bind("127.0.0.1:3000")
|
||||
.await
|
||||
.expect("Unable to start listener");
|
||||
|
||||
info!("Listening on {}", listener.local_addr().unwrap());
|
||||
|
||||
let app = app::app().await;
|
||||
|
||||
axum::serve(listener, app)
|
||||
.await
|
||||
.expect("Error serving application");
|
||||
start_api("localhost:3000").await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user