1
0
mirror of synced 2024-12-18 01:05:54 +01:00
GC-local-server-rewrite/WebUI/Program.cs
2023-02-18 01:29:20 +08:00

20 lines
680 B
C#

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