program.cs - set automatic detection for base URL

This commit is contained in:
Jan Beníček 2025-01-21 11:28:36 +01:00
parent b1a414ba90
commit a7365abfb1

View file

@ -6,7 +6,7 @@ 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("http://10.0.0.190") });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://10.0.0.190") });
await builder.Build().RunAsync();