diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-10-12 12:58:51 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-10-12 12:58:51 -0500 |
commit | 0ea877c5d0de10b45768da80c658785835d625e6 (patch) | |
tree | 38a5c6209e2063753f43e037e93a7e381bde16dd /src/main.rs | |
parent | 859fd855e1a819280931ffbb6ae98098b2774269 (diff) |
fix: preserve configured service order
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 85ff708..d5a35b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, fs::File, path::PathBuf}; +use std::{fs::File, path::PathBuf}; use tower_http::services::ServeDir; use tracing::level_filters::LevelFilter; @@ -21,7 +21,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { } }; - let state = AppState::spawn_services(config.services); + let state = AppState::new(config.services); let mut router = statsrv::router().with_state(state); if let Some(path) = config.serve_dir { @@ -41,7 +41,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { pub struct Config { pub serve_dir: Option<PathBuf>, pub address: String, - pub services: HashMap<String, ServiceConfig>, + pub services: Vec<ServiceConfig>, } impl Config { |