File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 4545HightlyFootballServiceTest test = new HightlyFootballServiceTest ( httpClient , configuration ) ;
4646await test . TestPlayerStats ( ) ;
4747
48+ // Track whether HTTPS is enabled
49+ bool isHttpsEnabled = false ;
50+
4851builder . WebHost . ConfigureKestrel ( options =>
4952{
5053 options . ListenAnyIP ( 5000 , listenOptions =>
6164 if ( File . Exists ( certificatePath ) )
6265 {
6366 listenOptions . UseHttps ( certificatePath , certificatePassword ) ;
67+ isHttpsEnabled = true ;
68+ Console . WriteLine ( "✅ HTTPS enabled with certificate." ) ;
6469 }
6570 else
6671 {
67- Console . WriteLine ( $ "⚠️ Certificate file not found at { certificatePath } . Running without HTTPS .") ;
72+ Console . WriteLine ( $ "⚠️ Certificate file not found at { certificatePath } . Running HTTP only .") ;
6873 }
6974 }
7075 else
96101app . MapControllers ( ) ;
97102
98103Console . WriteLine ( "================================" ) ;
99- Console . WriteLine ( "Backend server is running on https://localhost:5000" ) ;
104+ string protocol = isHttpsEnabled ? "https" : "http" ;
105+ Console . WriteLine ( $ "Backend server is running on { protocol } ://localhost:5000") ;
100106Console . WriteLine ( "✅ Test completed. Press any key to exit..." ) ;
101107app . Run ( ) ;
102108Console . ReadKey ( ) ;
You can’t perform that action at this time.
0 commit comments