settings devided into server and app
This commit is contained in:
@@ -7,7 +7,7 @@ pub mod hardware;
|
||||
pub mod metrics;
|
||||
pub mod models;
|
||||
|
||||
use crate::config::AppConfig;
|
||||
use crate::config::Settings;
|
||||
|
||||
use std::error::Error;
|
||||
use std::marker::Send;
|
||||
@@ -27,8 +27,11 @@ async fn flatten<T>(
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
let config = AppConfig::from_env().expect("Failed to load configuration");
|
||||
let server_url = config.watcher.server_url.clone();
|
||||
let settings = Settings::new().expect("Failed to load configuration");
|
||||
|
||||
// Explicit variables for each .env / config field
|
||||
let _app_port = settings.app.port;
|
||||
let server_url = settings.server.url;
|
||||
|
||||
// Registration
|
||||
let (server_id, ip) = match api::register_with_server(&server_url).await {
|
||||
|
Reference in New Issue
Block a user