1
0
mirror of synced 2024-11-27 16:10:53 +01:00
TaikoLocalServer/TaikoWebUI/Program.cs
asesidaa 7e43b44e24 Cache more on song data
Remove unnecessary using
2022-09-12 17:29:29 +08:00

24 lines
814 B
C#

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
{
BaseAddress = new Uri(builder.Configuration.GetValue<string>("BaseUrl"))
});
builder.Services.AddMudServices();
builder.Services.AddSingleton<IGameDataService, GameDataService>();
var host = builder.Build();
var gameDataService = host.Services.GetRequiredService<IGameDataService>();
#if DEBUG
await gameDataService.InitializeAsync(builder.Configuration.GetValue<string>("DataBaseUrl"));
#else
await gameDataService.InitializeAsync(builder.Configuration.GetValue<string>("BaseUrl"));
#endif
await host.RunAsync();