1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 08:32:50 -05:00

centralize ConfigurationBuilder

This commit is contained in:
Kyle Spearrin
2017-05-05 21:49:55 -04:00
parent 66c5a9b25d
commit 790ccb77c3
8 changed files with 31 additions and 47 deletions

View File

@ -25,7 +25,6 @@
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="1.1.1" />
<PackageReference Include="AspNetCoreRateLimit" Version="1.0.5" />

View File

@ -29,17 +29,7 @@ namespace Bit.Api
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("settings.json")
.AddJsonFile($"settings.{env.EnvironmentName}.json", optional: true);
if(env.IsDevelopment())
{
builder.AddUserSecrets<Startup>();
}
builder.AddEnvironmentVariables();
.AddSettingsConfiguration<Startup>(env);
Configuration = builder.Build();
Environment = env;
}