using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;

using Front;
using Front.Program.Services;

var builder = WebAssemblyHostBuilder.CreateDefault(args);

builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");


builder.Services.AddScoped(sp => //new HttpClient
{
    
    
    var config = builder.Configuration;
    var http = new HttpClient
    {
        // BaseAddress = new Uri("http://0.0.0.0:5144")
        BaseAddress = new Uri("https://devacamate.ipstein.myds.me")
        // BaseAddress = builder.HostEnvironment.IsDevelopment() 
        //     ? new Uri("https://devacamate.ipstein.myds.me") 
        //     : new Uri("https://acamate.ipstein.myds.me")
        
    };
    return http;
});

// SCOPED 으로 등록된 서비스는 DI 컨테이너에 등록된 서비스의 인스턴스를 사용합니다.
builder.Services.AddScoped<APIService>();
builder.Services.AddScoped<CookieService>();


await builder.Build().RunAsync();
