Browse Source
Docker working without Configure ConfigureAppConfiguration (#443)
* Docker working without Configure ConfigureAppConfiguration.
* Sort modifiers
main
Shady Nagy
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
16 deletions
-
src/PublicApi/Program.cs
-
src/Web/Program.cs
|
|
|
@ -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(); |
|
|
|
@ -44,13 +44,6 @@ namespace Microsoft.eShopWeb.PublicApi |
|
|
|
|
|
|
|
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>(); |
|
|
|
|
|
|
|
@ -43,14 +43,7 @@ namespace Microsoft.eShopWeb.Web |
|
|
|
|
|
|
|
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>(); |
|
|
|
}); |
|
|
|
|