diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 57ee526..6edd67c 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -35,12 +35,21 @@ pub use block::{Fingerprint, Id}; | |||
35 | use db::Db; | 35 | use db::Db; |
36 | use lazy_static::lazy_static; | 36 | use lazy_static::lazy_static; |
37 | use std::fs; | 37 | use std::fs; |
38 | use crate::config::Config; | ||
38 | 39 | ||
39 | #[tokio::main] | 40 | #[tokio::main] |
40 | async fn main() { | 41 | async fn main() { |
41 | log4rs::init_file("log.conf.yml", log4rs::config::Deserializers::default()).unwrap(); | 42 | log4rs::init_file("log.conf.yml", log4rs::config::Deserializers::default()).unwrap(); |
42 | 43 | ||
43 | let api = routes::application(Db::new()); | 44 | let config = match Config::read("config.yaml") { |
45 | Some(c) => c, | ||
46 | None => { | ||
47 | println!("Could not read config file, exiting."); | ||
48 | return; | ||
49 | }, | ||
50 | }; | ||
51 | |||
52 | let api = routes::application(Db::new(config)); | ||
44 | 53 | ||
45 | // Start the server | 54 | // Start the server |
46 | let point = ([127, 0, 0, 1], 8080); | 55 | let point = ([127, 0, 0, 1], 8080); |