Unleash client init

This commit is contained in:
Paul Schneider
2021-07-11 18:08:49 +01:00
parent d33a19d35f
commit 355b2d4c7c
4 changed files with 63 additions and 28 deletions

View File

@ -83,7 +83,6 @@ namespace isn
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app,
Microsoft.AspNetCore.Hosting.IHostingEnvironment env,
IOptions<UnleashClientSettings> unleashClientSettings,
ApplicationDbContext dbContext)
{
if (env.IsDevelopment())
@ -98,18 +97,7 @@ namespace isn
dbContext.Database.Migrate();
}
var unleashSettings = new UnleashSettings
{
UnleashApi = new Uri(unleashClientSettings.Value.ApiUrl),
AppName = "isnd",
Environment = env.EnvironmentName,
CustomHttpHeaders = new Dictionary<string, string>
{
{ "Authorization", unleashClientSettings.Value.ClientApiKey }
}
};
UnleashClientFactory unleashClientFactory = new UnleashClientFactory();
UnleashĈlient = unleashClientFactory.CreateClient(unleashSettings);
app.UseStatusCodePages().UseStaticFiles().UseAuthentication().UseMvc(routes =>
{