Skip to content

Commit

Permalink
Docker working without Configure ConfigureAppConfiguration (dotnet-ar…
Browse files Browse the repository at this point in the history
…chitecture#443)

* Docker working without Configure ConfigureAppConfiguration.

* Sort modifiers
  • Loading branch information
ShadyNagy authored Jul 31, 2020
1 parent f901db1 commit e520126
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
9 changes: 1 addition & 8 deletions src/PublicApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.eShopWeb.PublicApi
{
public class Program
{
public async static Task Main(string[] args)
public static async Task Main(string[] args)
{
var host = CreateHostBuilder(args)
.Build();
Expand Down Expand Up @@ -44,13 +44,6 @@ public async static Task Main(string[] args)

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((builderContext, config) =>
{
var env = builderContext.HostingEnvironment;
config
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
Expand Down
9 changes: 1 addition & 8 deletions src/Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ public static async Task Main(string[] args)

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((builderContext, config) =>
{
var env = builderContext.HostingEnvironment;
config
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
})
.ConfigureWebHostDefaults(webBuilder =>
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
Expand Down

0 comments on commit e520126

Please sign in to comment.