26 lines
855 B
C#
26 lines
855 B
C#
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 { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
|
builder.Services.AddScoped(sp => //new HttpClient
|
|
{
|
|
// BaseAddress = new Uri("https://localhost:5144")
|
|
var config = builder.Configuration;
|
|
var http = new HttpClient();
|
|
return http;
|
|
});
|
|
|
|
// SCOPED 으로 등록된 서비스는 DI 컨테이너에 등록된 서비스의 인스턴스를 사용합니다.
|
|
builder.Services.AddScoped<APIService>();
|
|
|
|
await builder.Build().RunAsync();
|