@@ -10,7 +10,7 @@ use hotfix::initiator::Initiator;
1010use hotfix:: message:: fix44;
1111use hotfix:: session:: SessionHandle ;
1212use hotfix:: store:: mongodb:: Client ;
13- use hotfix_web:: build_router ;
13+ use hotfix_web:: { RouterConfig , build_router_with_config } ;
1414use std:: path:: Path ;
1515use tokio:: select;
1616use tokio:: task:: spawn_blocking;
@@ -66,7 +66,7 @@ async fn main() {
6666 let initiator = start_session ( & args. config , & db_config, app) . await ;
6767
6868 let status_service_token = CancellationToken :: new ( ) ;
69- tokio:: spawn ( start_status_service (
69+ tokio:: spawn ( start_web_service (
7070 initiator. session_handle ( ) ,
7171 status_service_token. child_token ( ) ,
7272 ) ) ;
@@ -153,18 +153,21 @@ async fn start_session(
153153 }
154154}
155155
156- async fn start_status_service (
156+ async fn start_web_service (
157157 session_handle : SessionHandle < Message > ,
158158 cancellation_token : CancellationToken ,
159159) {
160- let status_router = build_router ( session_handle) ;
160+ let config = RouterConfig {
161+ enable_admin_endpoints : true ,
162+ } ;
163+ let router = build_router_with_config ( session_handle, config) ;
161164 let host_and_port = std:: env:: var ( "HOST_AND_PORT" ) . unwrap_or ( "0.0.0.0:9881" . to_string ( ) ) ;
162165 let listener = tokio:: net:: TcpListener :: bind ( & host_and_port) . await . unwrap ( ) ;
163166
164- info ! ( "starting status service on http://{host_and_port}" ) ;
167+ info ! ( "starting web interface on http://{host_and_port}" ) ;
165168
166169 select ! {
167- result = axum:: serve( listener, status_router ) => {
170+ result = axum:: serve( listener, router ) => {
168171 if let Err ( e) = result {
169172 tracing:: error!( "status service error: {}" , e) ;
170173 }
0 commit comments