From a0d5df1c5271cfd6301c3c7545c3bdbab0c37b6d Mon Sep 17 00:00:00 2001 From: Jackob_Punch Date: Sun, 1 Oct 2023 08:18:29 +0200 Subject: [PATCH] added packages and code in Program.cs to SignalIR --- src/Interlinked.Core/Interlinked.Core.csproj | 2 ++ src/Interlinked.Core/Program.cs | 25 +++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Interlinked.Core/Interlinked.Core.csproj b/src/Interlinked.Core/Interlinked.Core.csproj index cd83cbf..c640a98 100644 --- a/src/Interlinked.Core/Interlinked.Core.csproj +++ b/src/Interlinked.Core/Interlinked.Core.csproj @@ -9,6 +9,8 @@ + + diff --git a/src/Interlinked.Core/Program.cs b/src/Interlinked.Core/Program.cs index 779e1bf..88b7453 100644 --- a/src/Interlinked.Core/Program.cs +++ b/src/Interlinked.Core/Program.cs @@ -2,12 +2,25 @@ using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Interlinked.Core; using Syncfusion.Blazor; +using Microsoft.AspNetCore.ResponseCompression; +using Microsoft.AspNetCore.Builder; -var builder = WebAssemblyHostBuilder.CreateDefault(args); -builder.RootComponents.Add("#app"); -builder.RootComponents.Add("head::after"); -IServiceCollection serviceCollection = builder.Services.AddSyncfusionBlazor(); +internal class Program +{ + private static async Task Main(string[] args) + { + var builder = WebAssemblyHostBuilder.CreateDefault(args); + builder.RootComponents.Add("#app"); + builder.RootComponents.Add("head::after"); + IServiceCollection serviceCollection = builder.Services.AddSyncfusionBlazor(); -builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); + builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); -await builder.Build().RunAsync(); + builder.Services.AddResponseCompression(opts => + { + opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat( + new[] { "application/octet-stream" }); + }); + await builder.Build().RunAsync(); + } +} \ No newline at end of file