moved httpClient baseAddress to appsettings

This commit is contained in:
Sarah Faey 2022-11-22 22:51:37 +01:00
parent 2178ff54b6
commit e72b4daf51
6 changed files with 15 additions and 3 deletions

View file

@ -40,7 +40,7 @@ namespace DiscordBot
builder.Services.AddHttpClient(Constants.HTTP_CLIENT_NAME , httpClient =>
{
httpClient.BaseAddress = new Uri("https://localhost:7216/");
httpClient.BaseAddress = new Uri(builder.Configuration["HttpClients:LiebWebsite"]);
httpClient.DefaultRequestHeaders.Add(
HeaderNames.Accept, "application/vnd.github.v3+json");

View file

@ -4,5 +4,8 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"HttpClients": {
"LiebWebsite": "https://localhost:7216/"
}
}

View file

@ -5,5 +5,8 @@
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"HttpClients": {
"LiebWebsite": "lieb-website"
}
}