@@ -9,9 +9,9 @@ pub mod file_cache;
99pub mod hot_reload;
1010pub mod tls;
1111
12- pub mod static_file_filter;
13- pub mod service;
1412pub mod cors;
13+ pub mod service;
14+ pub mod static_file_filter;
1515
1616use crate :: admin_server:: AdminServer ;
1717use crate :: config:: { AdminConfig , Config } ;
@@ -44,7 +44,7 @@ fn load_config_and_cache() -> anyhow::Result<(Config, Arc<DomainStorage>)> {
4444 let config = Config :: load ( ) ?;
4545 tracing:: debug!( "config load:{:?}" , & config) ;
4646 let cache = FileCache :: new ( & config) ;
47- let domain_storage = Arc :: new ( DomainStorage :: init ( & config. file_dir , cache) ?) ;
47+ let domain_storage = Arc :: new ( DomainStorage :: init ( & config. file_dir , cache) ?) ;
4848 Ok ( ( config, domain_storage) )
4949}
5050
@@ -58,7 +58,7 @@ pub async fn reload_server(
5858 let config = Config :: load ( ) ?;
5959 if config. admin_config . as_ref ( ) == Some ( admin_config) {
6060 let cache = FileCache :: new ( & config) ;
61- let domain_storage = Arc :: new ( DomainStorage :: init ( & config. file_dir , cache) ?) ;
61+ let domain_storage = Arc :: new ( DomainStorage :: init ( & config. file_dir , cache) ?) ;
6262 let ( state, http_rx, https_rx) = HotReloadState :: init ( & config) ;
6363 let server = Server :: new ( config. clone ( ) , domain_storage. clone ( ) ) ;
6464 tokio:: task:: spawn ( async move { server. run ( http_rx, https_rx) . await } ) ;
@@ -68,6 +68,7 @@ pub async fn reload_server(
6868 }
6969 Ok ( ( ) )
7070}
71+
7172pub async fn run_server ( ) -> anyhow:: Result < ( ) > {
7273 let ( config, domain_storage) = load_config_and_cache ( ) . expect ( "prepare config and cache file" ) ;
7374 if config. port <= 0 && config. https . is_none ( ) {
0 commit comments