This commit is contained in:
2026-05-10 03:16:13 +02:00
parent 5f05108132
commit 0b441b0759
77 changed files with 2100 additions and 71 deletions
+23
View File
@@ -0,0 +1,23 @@
use std::net::SocketAddr;
use axum::Router;
use tokio::net::TcpListener;
use crate::config::AppConfig;
use crate::routes;
pub async fn start(config: &AppConfig) -> Result<(), Box<dyn std::error::Error>> {
let addr = SocketAddr::new(
std::net::IpAddr::V4(config.network.host),
config.network.tcp_port,
);
let app: Router = routes::router();
let listener = TcpListener::bind(addr).await?;
tracing::info!(%addr, "HTTP server listening");
axum::serve(listener, app).await?;
Ok(())
}