fix 聚合swagger

This commit is contained in:
2024-03-14 19:29:30 +08:00
parent 2cdba175bd
commit efbb72105c
5 changed files with 80 additions and 15 deletions

View File

@@ -1,16 +1,19 @@
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddJsonFile("ocelot.json", true, true);
// Add services to the container.
using Gateway;
builder.Services.AddOcelot();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseOcelot().Wait();
app.Run();
public class Program
{
public static void Main(string[] args)
{
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(builder =>
{
builder.AddJsonFile("ocelot.json", true, true);
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.Build().Run();
}
}