Set up monorepo Docker development

This commit is contained in:
2026-09-19 20:56:07 +02:00
parent ab4cfe40c8
commit 5b45203c14
13 changed files with 33 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
use std::env;
use tokio::net::TcpListener;
mod models;
mod routes;
#[tokio::main]
#[tracing::instrument]
async fn main() {
dotenv::dotenv().ok();
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.init();
let host = env::var("HOST").unwrap_or_else(|_| "0.0.0.0".to_string());
let port = env::var("PORT").unwrap_or_else(|_| "3000".to_string());
let listener = TcpListener::bind(format!("{}:{}", host, port))
.await
.expect("Failed to bind to address");
tracing::info!("Starting server at {}:{}", host, port);
axum::serve(listener, routes::create_router().into_make_service())
.await
.expect("Failed to start server");
}