Move load_config to Config::from_env
This commit is contained in:
@@ -10,7 +10,7 @@ use tower_http::services::ServeFile;
|
||||
use crate::App;
|
||||
use crate::app::LOGO_ICO;
|
||||
use crate::server::{
|
||||
auth::build_auth_layer, config, database, key_val_store,
|
||||
auth::build_auth_layer, config::Config, database, key_val_store,
|
||||
require_auth_mw::require_auth_middleware,
|
||||
};
|
||||
use crate::util::error::{Contextualize, Error, ErrorType, Result};
|
||||
@@ -21,7 +21,7 @@ pub async fn main() -> Result<std::convert::Infallible> {
|
||||
}
|
||||
|
||||
tracing::debug!("Loading configuration...");
|
||||
let config = config::load_config()
|
||||
let config = Config::from_env()
|
||||
.map_err(|e| Error::message_here(e.to_string()))
|
||||
.err_context("Failed to load config")?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user