1
0
mirror of synced 2025-01-18 15:54:06 +01:00

27 lines
902 B
C#
Raw Normal View History

2022-09-05 01:19:42 +08:00
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using TaikoWebUI;
using MudBlazor.Services;
using TaikoWebUI.Services;
2022-09-05 01:19:42 +08:00
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddSingleton(sp => new HttpClient
2022-09-05 01:19:42 +08:00
{
BaseAddress = new Uri(builder.Configuration.GetValue<string>("BaseUrl"))
});
builder.Services.AddMudServices();
builder.Services.AddSingleton<IGameDataService, GameDataService>();
2022-09-05 01:19:42 +08:00
var host = builder.Build();
var gameDataService = host.Services.GetRequiredService<IGameDataService>();
2022-09-10 01:27:20 +08:00
#if DEBUG
await gameDataService.InitializeAsync(builder.Configuration.GetValue<string>("DataBaseUrl"));
2022-09-10 01:27:20 +08:00
#else
await gameDataService.InitializeAsync(builder.Configuration.GetValue<string>("BaseUrl"));
#endif
await host.RunAsync();