I have multiple microservices, and I am trying to merge them using Ocelot API Gateways. I have created different JSON files for each microservice and I'm adding them using the code below. However, it's not working; it's loading only the last JSON file.
Code:
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
var builder = WebApplication.CreateBuilder(args);
// Add multiple Ocelot configuration files
builder.Configuration.AddJsonFile("ocelot.BIAManagementService.json", optional: true, reloadOnChange: true);
builder.Configuration.AddJsonFile("ocelot.EventManagementService.json", optional: true, reloadOnChange: true);
builder.Configuration.AddJsonFile("ocelot.OrganizationManagementService.json", optional: true, reloadOnChange: true);
builder.Configuration.AddJsonFile("ocelot.RiskManagementService.json", optional: true, reloadOnChange: true);
builder.Configuration.AddJsonFile("ocelot.RVManagementService.json", optional: true, reloadOnChange: true);
builder.Configuration.AddJsonFile("ocelot.SRRManagementService.json", optional: true, reloadOnChange: true);
builder.Services.AddOcelot(builder.Configuration);
var app = builder.Build();
await app.UseOcelot();
app.Run();
Are any changes needed?