made backend database url configurable through cli

This commit is contained in:
2025-12-31 18:03:17 +01:00
parent fa40aa404d
commit 1ebec422d6
5 changed files with 11 additions and 7 deletions

View File

@@ -29,6 +29,10 @@ pub struct Cli {
#[arg(short, long, default_value = "8080")]
port: String,
/// Database URL
#[arg(short, long, default_value = "localhost:5432")]
database: String,
/// Verbose mode
#[arg(short, long)]
verbose: bool,
@@ -43,7 +47,7 @@ async fn main() -> anyhow::Result<()> {
.init();
tracing::info!("Connecting to database...");
let db_pool = db::init_db().await?;
let db_pool = db::init_db(cli.database).await?;
let cors = CorsLayer::new()
.allow_origin(Any)