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> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.11" /> <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.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" /> <PackageReference Include="Syncfusion.Blazor.Maps" Version="23.1.38" />
</ItemGroup> </ItemGroup>

View file

@ -2,12 +2,25 @@ using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Interlinked.Core; using Interlinked.Core;
using Syncfusion.Blazor; using Syncfusion.Blazor;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.AspNetCore.Builder;
var builder = WebAssemblyHostBuilder.CreateDefault(args); internal class Program
builder.RootComponents.Add<App>("#app"); {
builder.RootComponents.Add<HeadOutlet>("head::after"); private static async Task Main(string[] args)
IServiceCollection serviceCollection = builder.Services.AddSyncfusionBlazor(); {
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("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();
}
}