mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 08:32:50 -05:00
centralize ConfigurationBuilder
This commit is contained in:
@ -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" />
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user