using GameIdeas.BlazorApp;
using GameIdeas.Resources;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

UriBuilder uriBuilder = new(builder.HostEnvironment.BaseAddress)
{
    Port = 8000
};

builder.Services.AddHttpClient(
    "GameIdeas.WebAPI",
    client =>
    {
        client.BaseAddress = uriBuilder.Uri;
        client.Timeout = TimeSpan.FromMinutes(3);
    });

builder.Services.AddSingleton<TranslationService>();
builder.Services.AddSingleton<Translations>();

await builder.Build().RunAsync();