chore: ocelot installiert und für den Beispieldienst konfiguriert
This commit is contained in:
26
Program.cs
Normal file
26
Program.cs
Normal 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();
|
||||
Reference in New Issue
Block a user