mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 21:02:50 +08:00

* #212 - hacked websockets proxy together * faffing around * #212 hacking away :( * #212 websockets proxy middleware working * #212 map when for webockets working * #212 some test refactor * #212 temp commit * #212 websockets proxy working, tests passing...need to do some tidying and write docs * #212 more code coverage * #212 docs for websockets * #212 updated readme * #212 tidying up after websockets refactoring * #212 tidying up after websockets refactoring * #212 tidying up after websockets refactoring * changing logging levels and logging like ms reccomends with structured data rather than strings * more faffing * more fafin * #287 ocelot logger now only takes strings as it did take params then just turned them to strings, misleading, unit tests for logger and diagnosticlogger * #287 errors now logged as they happen * #287 more detail for logs requested in issue * #287 tidy up * #287 renamed * #287 always log context id * #287 fixed me being an idiot * #287 removed crap websockets unit test that isnt a unit test * #287 removed crap websockets unit test that isnt a unit test
62 lines
2.3 KiB
C#
62 lines
2.3 KiB
C#
using System.IO;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Ocelot.DependencyInjection;
|
|
using Ocelot.Middleware;
|
|
|
|
namespace Ocelot.ManualTest
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
new WebHostBuilder()
|
|
.UseKestrel()
|
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
|
.ConfigureAppConfiguration((hostingContext, config) =>
|
|
{
|
|
config
|
|
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
|
|
.AddJsonFile("appsettings.json", true, true)
|
|
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true)
|
|
.AddJsonFile("configuration.json")
|
|
.AddEnvironmentVariables();
|
|
})
|
|
.ConfigureServices(s => {
|
|
s.AddAuthentication()
|
|
.AddJwtBearer("TestKey", x =>
|
|
{
|
|
x.Authority = "test";
|
|
x.Audience = "test";
|
|
});
|
|
|
|
s.AddOcelot()
|
|
.AddCacheManager(x =>
|
|
{
|
|
x.WithDictionaryHandle();
|
|
})
|
|
/* .AddOpenTracing(option =>
|
|
{
|
|
option.CollectorUrl = "http://localhost:9618";
|
|
option.Service = "Ocelot.ManualTest";
|
|
})*/
|
|
.AddAdministration("/administration", "secret");
|
|
})
|
|
.ConfigureLogging((hostingContext, logging) =>
|
|
{
|
|
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
|
|
logging.AddConsole();
|
|
})
|
|
.UseIISIntegration()
|
|
.Configure(app =>
|
|
{
|
|
app.UseOcelot().Wait();
|
|
})
|
|
.Build()
|
|
.Run();
|
|
}
|
|
}
|
|
}
|