chore: ocelot installiert und für den Beispieldienst konfiguriert

This commit is contained in:
Developer 02
2025-01-15 14:36:38 +01:00
parent 9def5216be
commit eceaf066d7
7 changed files with 144 additions and 0 deletions

26
Program.cs Normal file
View File

@@ -0,0 +1,26 @@
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
var builder = WebApplication.CreateBuilder(args);
// Make sure to add the Ocelot configuration file
builder.Configuration.AddJsonFile("ocelot.json");
// Add Ocelot services
builder.Services.AddOcelot();
var app = builder.Build();
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
// Use Ocelot middleware in an appropriate way
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.UseOcelot().Wait();
app.Run();