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

* hacked together load balancing reroutes in fileconfig * some renaming and refactoring * more renames * hacked away the old config json * test for issue 213 * renamed key * dont share ports * oops * updated docs * mvoed docs around * port being used
30 lines
1002 B
C#
30 lines
1002 B
C#
using CacheManager.Core;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Ocelot.DependencyInjection;
|
|
using Ocelot.AcceptanceTests.Caching;
|
|
|
|
namespace Ocelot.AcceptanceTests
|
|
{
|
|
public class StartupWithConsulAndCustomCacheHandle : AcceptanceTestsStartup
|
|
{
|
|
public StartupWithConsulAndCustomCacheHandle(IHostingEnvironment env) : base(env) { }
|
|
|
|
public override void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddOcelot(Configuration)
|
|
.AddCacheManager((x) =>
|
|
{
|
|
x.WithMicrosoftLogging(log =>
|
|
{
|
|
log.AddConsole(LogLevel.Debug);
|
|
})
|
|
.WithJsonSerializer()
|
|
.WithHandle(typeof(InMemoryJsonHandle<>));
|
|
})
|
|
.AddStoreOcelotConfigurationInConsul();
|
|
}
|
|
}
|
|
}
|