Files
2025-04-09 07:37:23 +02:00

51 lines
1.1 KiB
C#

using EgwCoreLib.BlazorTest;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Radzen;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
// aggiunto compressione
builder.Services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
});
// aggiungo componenti radzen
builder.Services.AddRadzenComponents();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UsePathBase("/BlazorTest/");
// disabilita risposta compressa in debug
if (!app.Environment.IsDevelopment())
{
app.UseResponseCompression();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();