feat(server): tracing and http2
This commit is contained in:
parent
5a5ab7ad52
commit
b6179147f3
2 changed files with 8 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ use axum::Router;
|
|||
use repo::RepoGroupManager;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::{Arc, RwLock};
|
||||
use tower_http::trace::TraceLayer;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Config {
|
||||
|
|
@ -42,10 +43,13 @@ async fn main() {
|
|||
repo_manager: Arc::new(RwLock::new(repo_manager)),
|
||||
};
|
||||
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
// build our application with a single route
|
||||
let app = Router::new()
|
||||
.merge(repo::router(&global))
|
||||
.with_state(global);
|
||||
.with_state(global)
|
||||
.layer(TraceLayer::new_for_http());
|
||||
|
||||
// run it with hyper on localhost:3000
|
||||
axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue