diff options
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/main.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/src/main.rs b/server/src/main.rs index 3da0e43..b10831f 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -19,8 +19,17 @@ pub mod federation; pub mod import; pub mod routes; -pub static CONF: Lazy<GlobalConfig> = - Lazy::new(|| serde_json::from_reader(File::open("data/config.json").unwrap()).unwrap()); +pub static CONF: Lazy<GlobalConfig> = Lazy::new(|| { + serde_json::from_reader( + File::open( + std::env::args() + .nth(1) + .expect("First argument must specify the config.json to use."), + ) + .unwrap(), + ) + .unwrap() +}); fn main() { enable_logging(); |