24 lines
617 B
Rust
24 lines
617 B
Rust
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(())
|
|
}
|