using Microsoft.AspNetCore.ResponseCompression; using SummerBestWebForm2.ClassObj; using SummerBestWebForm2.Components; using System.IO.Compression; namespace SummerBestWebForm2 { public class Program { public static void Main(string[] args) { var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); builder.Services.AddResponseCompression(options => { options.EnableForHttps = true; options.Providers.Add(); options.Providers.Add(); }); builder.Services.Configure(options => { options.Level = CompressionLevel.Fastest; }); builder.Services.Configure(options => { options.Level = CompressionLevel.SmallestSize; }); builder.Services.AddDataProtection(); builder.Services.AddHttpContextAccessor(); builder.Services.AddScoped(); builder.Services.AddScoped(); // IPADDR 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(); } var webSocketOptions = new WebSocketOptions() { KeepAliveInterval = TimeSpan.FromSeconds(15) }; app.UseWebSockets(webSocketOptions); app.UseResponseCompression(); app.UseResponseCaching(); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseAntiforgery(); app.MapRazorComponents() .AddInteractiveServerRenderMode(); app.Run(); } } }