added packages and code in Program.cs to SignalIR

This commit is contained in:
Jackob_Punch 2023-10-01 08:18:29 +02:00
parent 43b20f03dd
commit a0d5df1c52
2 changed files with 21 additions and 6 deletions

View file

@ -9,6 +9,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.11" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.11" />
<PackageReference Include="Syncfusion.Blazor.Maps" Version="23.1.38" />
</ItemGroup>

View file

@ -2,7 +2,13 @@ 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;
internal class Program
{
private static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
@ -10,4 +16,11 @@ IServiceCollection serviceCollection = builder.Services.AddSyncfusionBlazor();
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddResponseCompression(opts =>
{
opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
new[] { "application/octet-stream" });
});
await builder.Build().RunAsync();
}
}