996ad5c4c8
Add clap-powered --bind, --static-dir, and --data-dir flags for human-run server configuration. The merge order is now explicit: command-line arguments win over UPL_* environment variables, which still fall back to the existing repository-local defaults. Document the new flags and allow just run to forward arguments to cargo so the help text can be checked through the normal task runner. Test Plan: - just check - cargo run -- --help Refs: none
16 lines
387 B
Rust
16 lines
387 B
Rust
use std::error::Error;
|
|
|
|
use upl::app::{AppConfig, build_router};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Box<dyn Error>> {
|
|
let config = AppConfig::from_args()?;
|
|
let listener = tokio::net::TcpListener::bind(config.bind_addr).await?;
|
|
|
|
println!("upl listening on http://{}", listener.local_addr()?);
|
|
|
|
axum::serve(listener, build_router(&config)).await?;
|
|
|
|
Ok(())
|
|
}
|