vidow/vidow-backend/crates/vidow_bin/src/main.rs

24 lines
617 B
Rust
Raw Normal View History

2022-10-20 21:46:33 +02:00
use eyre::Context;
use tracing::info;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
use vidow_core::config::AppConfig;
#[tokio::main]
fn main() -> eyre::Result<()> {
dotenv::dotenv().context("could not load .env file")?;
let config = AppConfig::new();
tracing_subscriber::registry()
.with(tracing_subscriber::EnvFilter::new(config.rust_log()))
.with(tracing_subscriber::fmt::layer())
.init();
info!("environment loaded and configuration parsed");
Api::serve(config)
.await
.context("could not initialize api")?;
Ok(())
}