1
0
mirror of synced 2024-11-24 06:50:15 +01:00
TaikoLocalServer/TaikoWebUI/Program.cs

20 lines
669 B
C#
Raw Normal View History

2022-09-04 19:19:42 +02:00
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddSingleton(sp => new HttpClient
2022-09-04 19:19:42 +02:00
{
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
2022-09-04 19:19:42 +02:00
});
builder.Services.AddMudServices();
builder.Services.AddSingleton<IGameDataService, GameDataService>();
2022-09-04 19:19:42 +02:00
var host = builder.Build();
var gameDataService = host.Services.GetRequiredService<IGameDataService>();
await gameDataService.InitializeAsync(builder.HostEnvironment.BaseAddress);
await host.RunAsync();