Created
October 5, 2020 07:05
-
-
Save rahulsahay19/0b54b488ba47f1de7fff864b23fc8419 to your computer and use it in GitHub Desktop.
program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
namespace OcelotGateway | |
{ | |
public static class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
CreateHostBuilder(args).Build().Run(); | |
} | |
public static IHostBuilder CreateHostBuilder(string[] args) => | |
Host.CreateDefaultBuilder(args) | |
.ConfigureWebHostDefaults(webBuilder => | |
{ | |
var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); | |
webBuilder.UseStartup<Startup>(); | |
webBuilder.ConfigureAppConfiguration(config => | |
{ | |
config.AddJsonFile($"ocelot.{env}.json"); | |
}); | |
}).ConfigureLogging(logging =>{ | |
logging.AddConsole(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment