0
|
1 using Radzen;
|
|
2 using Grille2.Components;
|
|
3
|
|
4 var builder = WebApplication.CreateBuilder(args);
|
|
5
|
|
6 // Add services to the container.
|
|
7 builder.Services.AddRazorComponents()
|
|
8 .AddInteractiveServerComponents().AddHubOptions(options => options.MaximumReceiveMessageSize = 10 * 1024 * 1024);
|
|
9
|
|
10 builder.Services.AddControllers();
|
|
11 builder.Services.AddRadzenComponents();
|
|
12
|
|
13 builder.Services.AddRadzenCookieThemeService(options =>
|
|
14 {
|
|
15 options.Name = "Grille2Theme";
|
|
16 options.Duration = TimeSpan.FromDays(365);
|
|
17 });
|
|
18 builder.Services.AddHttpClient();
|
|
19 var app = builder.Build();
|
|
20
|
|
21 // Configure the HTTP request pipeline.
|
|
22 if (!app.Environment.IsDevelopment())
|
|
23 {
|
|
24 app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
25 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
26 app.UseHsts();
|
|
27 }
|
|
28
|
|
29 app.UseHttpsRedirection();
|
|
30 app.MapControllers();
|
|
31 app.UseStaticFiles();
|
|
32 app.UseAntiforgery();
|
|
33
|
|
34 app.MapRazorComponents<App>()
|
|
35 .AddInteractiveServerRenderMode();
|
|
36
|
|
37 app.Run(); |