Allow config path from FOURTH_CONFIG
This commit is contained in:
@ -5,10 +5,13 @@ mod servers;
|
||||
use crate::config::Config;
|
||||
use crate::servers::Server;
|
||||
|
||||
use std::env;
|
||||
use log::{debug, error};
|
||||
|
||||
fn main() {
|
||||
let config = match Config::new("/etc/fourth/config.yaml") {
|
||||
let config_path = env::var("FOURTH_CONFIG").unwrap_or_else(|_| "/etc/fourth/config.yaml".to_string());
|
||||
|
||||
let config = match Config::new(&config_path) {
|
||||
Ok(config) => config,
|
||||
Err(e) => {
|
||||
println!("Could not load config: {:?}", e);
|
||||
|
Reference in New Issue
Block a user