This line causes a null reference exception:
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.Configuration.GetValue<string>("BaseApiUrl")) });
This is my appsettings.json that I put in the wwwroot folder directly:
{
"BaseApiUrl": "https://localhost:44327"
}
Do you know what the problem is?
I expect to have the correct value returned.
You can use AddHttpClient extention