Something went wrong. Try again.
Something went wrong. Try again.
692 B · 25 lines
Rust
at main
1234567891011121314151617181920212223242526use std::path::Path;
use backend::{AppState, config::Config, device_storage::DeviceStorage, run_http, run_tcp};use color_eyre::eyre;use tracing::Level;
#[tokio::main]async fn main() -> eyre::Result<()> { let config = Config::load()?;
tracing_subscriber::fmt().with_max_level(Level::INFO).init();
let (device_change_events, _) = tokio::sync::broadcast::channel(8); let state = AppState { device_storage: DeviceStorage::load(Path::new(&config.device_storage_path).to_path_buf()) .await?, device_change_events, }; tokio::try_join!( run_http(state.clone(), &config), run_tcp(state.clone(), &config) )?;
Ok(())}