1
0
mirror of synced 2024-12-18 17:25:54 +01:00
GC-local-server-rewrite/WebUI/Program.cs

20 lines
680 B
C#
Raw Normal View History

2023-02-16 17:38:01 +01:00
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using WebUI;
using MudBlazor.Services;
2023-02-17 18:29:20 +01:00
using WebUI.Services;
2023-02-16 17:38:01 +01:00
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
2023-02-17 18:29:20 +01:00
builder.Services.AddSingleton(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
2023-02-16 17:38:01 +01:00
builder.Services.AddMudServices();
2023-02-17 18:29:20 +01:00
builder.Services.AddSingleton<IDataService, DataService>();
2023-02-16 17:38:01 +01:00
2023-02-17 18:29:20 +01:00
var host = builder.Build();
var service = host.Services.GetRequiredService<IDataService>();
await service.InitializeAsync();
await host.RunAsync();