mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 04:48:17 +08:00
more work towards getting identity server and admin area set up
This commit is contained in:
@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Ocelot.Configuration.Provider;
|
||||
using Ocelot.DependencyInjection;
|
||||
using Ocelot.Middleware;
|
||||
using ConfigurationBuilder = Microsoft.Extensions.Configuration.ConfigurationBuilder;
|
||||
@ -14,6 +15,8 @@ namespace Ocelot.ManualTest
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
private IdentityServerConfiguration _identityServerConfig;
|
||||
|
||||
public Startup(IHostingEnvironment env)
|
||||
{
|
||||
var builder = new ConfigurationBuilder()
|
||||
@ -24,6 +27,9 @@ namespace Ocelot.ManualTest
|
||||
.AddEnvironmentVariables();
|
||||
|
||||
Configuration = builder.Build();
|
||||
|
||||
var identityServerConfigProvider = new HardCodedIdentityServerConfigurationProvider();
|
||||
_identityServerConfig = identityServerConfigProvider.Get();
|
||||
}
|
||||
|
||||
public IConfigurationRoot Configuration { get; }
|
||||
@ -41,14 +47,14 @@ namespace Ocelot.ManualTest
|
||||
|
||||
services.AddOcelotOutputCaching(settings);
|
||||
services.AddOcelotFileConfiguration(Configuration);
|
||||
services.AddOcelot();
|
||||
services.AddOcelot(_identityServerConfig);
|
||||
}
|
||||
|
||||
public async void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||
{
|
||||
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
||||
|
||||
await app.UseOcelot();
|
||||
await app.UseOcelot(_identityServerConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user