@@ -5,39 +5,39 @@ namespace ColorControl.UI;
55
66public static class Blazor
77{
8- public static void Start ( Config ? config = null )
9- {
10- var builder = WebApplication . CreateBuilder ( ) ;
8+ public static void Start ( Config ? config = null )
9+ {
10+ var builder = WebApplication . CreateBuilder ( ) ;
1111
12- // Add services to the container.
13- builder . Services . AddRazorComponents ( )
14- . AddInteractiveServerComponents ( ) ;
12+ // Add services to the container.
13+ builder . Services . AddRazorComponents ( )
14+ . AddInteractiveServerComponents ( ) ;
1515
16- builder . Services . AddSingleton < AppState > ( new AppState { SelectedTheme = ( config ? . UseDarkMode ?? true ) ? "dark" : "light" } ) ;
17- builder . Services . AddTransient < RpcUiClientService > ( ) ;
18- builder . Services . AddTransient < JSHelper > ( ) ;
19- builder . Services . AddHttpContextAccessor ( ) ;
20- builder . Services . AddSingleton < NotificationService > ( ) ;
21- builder . WebHost . ConfigureKestrel ( o => o . ListenAnyIP ( config ? . UiPort > 0 ? config . UiPort : 5000 ) ) ;
16+ builder . Services . AddSingleton < AppState > ( new AppState { SelectedTheme = ( config ? . UseDarkMode ?? true ) ? "dark" : "light" } ) ;
17+ builder . Services . AddTransient < RpcUiClientService > ( ) ;
18+ builder . Services . AddTransient < JSHelper > ( ) ;
19+ builder . Services . AddHttpContextAccessor ( ) ;
20+ builder . Services . AddSingleton < NotificationService > ( ) ;
21+ builder . WebHost . ConfigureKestrel ( o => o . ListenAnyIP ( config ? . UiPort > 0 ? config . UiPort : 5000 ) ) ;
2222
23- var app = builder . Build ( ) ;
23+ var app = builder . Build ( ) ;
2424
25- // Configure the HTTP request pipeline.
26- if ( ! app . Environment . IsDevelopment ( ) )
27- {
28- app . UseExceptionHandler ( "/Error" , createScopeForErrors : true ) ;
29- // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
30- app . UseHsts ( ) ;
31- }
25+ // Configure the HTTP request pipeline.
26+ if ( ! app . Environment . IsDevelopment ( ) )
27+ {
28+ app . UseExceptionHandler ( "/Error" , createScopeForErrors : true ) ;
29+ // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
30+ app . UseHsts ( ) ;
31+ }
3232
33- app . UseHttpsRedirection ( ) ;
33+ app . UseHttpsRedirection ( ) ;
3434
35- app . UseStaticFiles ( ) ;
36- app . UseAntiforgery ( ) ;
35+ app . UseStaticFiles ( ) ;
36+ app . UseAntiforgery ( ) ;
3737
38- app . MapRazorComponents < Components . App > ( )
39- . AddInteractiveServerRenderMode ( ) ;
38+ app . MapRazorComponents < Components . App > ( )
39+ . AddInteractiveServerRenderMode ( ) ;
4040
41- app . Run ( ) ;
42- }
41+ app . Run ( ) ;
42+ }
4343}
0 commit comments