mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-23 22:22:51 +08:00

* Upgrade Projects * Push to trigger builds * Tried Thread Sleep before deleting file * FileDeleteTryCatch * Updated from AspnetCore All to App * Travis version Upgrade (.net core 2.2) * dotnet 2.2.105
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using Microsoft.AspNetCore;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Ocelot.DependencyInjection;
|
|
using Ocelot.Middleware;
|
|
using Ocelot.Provider.Kubernetes;
|
|
|
|
namespace ApiGateway
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
BuildWebHost(args).Run();
|
|
}
|
|
|
|
public static IWebHost BuildWebHost(string[] args) =>
|
|
WebHost.CreateDefaultBuilder(args)
|
|
.ConfigureAppConfiguration((hostingContext, config) =>
|
|
{
|
|
config
|
|
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
|
|
.AddJsonFile("appsettings.json", true, true)
|
|
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true)
|
|
.AddJsonFile("ocelot.json", false, false)
|
|
.AddEnvironmentVariables();
|
|
})
|
|
.UseStartup<Startup>()
|
|
.Build();
|
|
}
|
|
}
|
|
|