@@ -657,6 +657,7 @@ void CommandLineParser::SetupSystemCommands() {
657
657
auto start_cmd = app_.add_subcommand (" start" , " Start the API server" );
658
658
start_cmd->group (kSystemGroup );
659
659
cml_data_.port = std::stoi (cml_data_.config .apiServerPort );
660
+ start_cmd->add_option (" --host" , cml_data_.server_host , " Server host" );
660
661
start_cmd->add_option (" -p, --port" , cml_data_.port , " Server port to listen" );
661
662
start_cmd->add_option (" --loglevel" , cml_data_.log_level ,
662
663
" Set up log level for server, accepted TRACE, DEBUG, "
@@ -671,10 +672,14 @@ void CommandLineParser::SetupSystemCommands() {
671
672
start_cmd->callback ([this ] {
672
673
if (std::exchange (executed_, true ))
673
674
return ;
674
- if (cml_data_.port != stoi (cml_data_.config .apiServerPort )) {
675
- CTL_INF (" apiServerPort changed from " << cml_data_.config .apiServerPort
676
- << " to " << cml_data_.port );
675
+ if (cml_data_.port != stoi (cml_data_.config .apiServerPort ) ||
676
+ cml_data_.server_host != cml_data_.config .apiServerHost ) {
677
+ CTL_INF (" API server host:port changed from "
678
+ << cml_data_.config .apiServerHost << " :"
679
+ << cml_data_.config .apiServerPort << " to "
680
+ << cml_data_.server_host << " :" << cml_data_.port );
677
681
auto config_path = file_manager_utils::GetConfigurationPath ();
682
+ cml_data_.config .apiServerHost = cml_data_.server_host ;
678
683
cml_data_.config .apiServerPort = std::to_string (cml_data_.port );
679
684
auto result =
680
685
config_yaml_utils::CortexConfigMgr::GetInstance ().DumpYamlConfig (
0 commit comments