mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-24 06:52:49 +08:00

* hacking around to work out why logging and request id isnt working * pass request id into logger so it can be structured, removed a bunch of debug logging we dont need because diagnostic trace gets it * changed config dependency * always have tracing available * made it so we dont need to pass config into services.AddOcelot anymore with .net core 2.0 * add test * lots of changes relating to logging and request ids, also updated documentation * fixed failing test i missed
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System;
|
|
using CacheManager.Core;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Ocelot.DependencyInjection;
|
|
using Ocelot.Middleware;
|
|
using ConfigurationBuilder = Microsoft.Extensions.Configuration.ConfigurationBuilder;
|
|
|
|
namespace Ocelot.ManualTest
|
|
{
|
|
public class ManualTestStartup
|
|
{
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
Action<ConfigurationBuilderCachePart> settings = (x) =>
|
|
{
|
|
x.WithDictionaryHandle();
|
|
};
|
|
|
|
services.AddAuthentication()
|
|
.AddJwtBearer("TestKey", x =>
|
|
{
|
|
x.Authority = "test";
|
|
x.Audience = "test";
|
|
});
|
|
|
|
services.AddOcelot()
|
|
.AddCacheManager(settings)
|
|
.AddAdministration("/administration", "secret");
|
|
}
|
|
|
|
public void Configure(IApplicationBuilder app)
|
|
{
|
|
app.UseOcelot().Wait();
|
|
}
|
|
}
|
|
}
|