@@ -9,7 +9,9 @@ use reqwest::Url;
99use schemars:: JsonSchema ;
1010use serde:: { Deserialize , Serialize } ;
1111
12- pub const DEFAULT_BOARD_SERVER : & str = "http://localhost" ;
12+ // Keep the URL-based configuration aligned with ostool-server's established
13+ // default listen port so a newly generated config works without user edits.
14+ pub const DEFAULT_BOARD_SERVER : & str = "http://localhost:2999" ;
1315
1416#[ derive( Debug , Clone , Copy , Serialize , Deserialize , JsonSchema , PartialEq , Eq , Default ) ]
1517#[ serde( rename_all = "snake_case" ) ]
@@ -221,13 +223,25 @@ mod tests {
221223 let loaded = LoadedBoardGlobalConfig :: load_or_create_at ( & path) . unwrap ( ) ;
222224
223225 assert ! ( loaded. created) ;
224- assert_eq ! ( loaded. board. server, "http://localhost" ) ;
226+ assert_eq ! ( loaded. board. server, "http://localhost:2999 " ) ;
225227 assert_eq ! ( loaded. board. port, None ) ;
226228 let content = std:: fs:: read_to_string ( & path) . unwrap ( ) ;
227- assert ! ( content. contains( "server = \" http://localhost\" " ) ) ;
229+ assert ! ( content. contains( "server = \" http://localhost:2999 \" " ) ) ;
228230 assert ! ( !content. contains( "server_ip" ) ) ;
229231 }
230232
233+ #[ test]
234+ fn default_config_resolves_to_the_board_server_default_port ( ) {
235+ assert_eq ! (
236+ BoardGlobalConfig :: default ( )
237+ . resolve_endpoint( None , None )
238+ . unwrap( )
239+ . base_url
240+ . as_str( ) ,
241+ "http://localhost:2999/"
242+ ) ;
243+ }
244+
231245 #[ test]
232246 fn resolve_endpoint_uses_url_port_or_scheme_default ( ) {
233247 let config = BoardGlobalConfig {
0 commit comments