Refactor to clean-up axum server implementation
This commit is contained in:
parent
09e538872d
commit
4b16f39b4d
10 changed files with 1308 additions and 57 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
use uprs::state::AppState;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
|
@ -13,5 +14,7 @@ async fn main() {
|
|||
|
||||
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
|
||||
tracing::info!("listening on {}", listener.local_addr().unwrap());
|
||||
axum::serve(listener, uprs::app()).await.unwrap();
|
||||
axum::serve(listener, uprs::app(AppState::new().await))
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue