I'm creating a project with microservices and now I want to be able to test the API gateway with ocelot API every time I try to access https://localhost:4482/gateway/product give me
"can't reach this page"
ocelot.json:
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/product",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44
}
],
"UpstreamPathTemplate": "/gateway/product",
"UpstreamHttpMethod": [ "GET"]
},
{
"DownstreamPathTemplate": "/api/Order",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44
}
],
"UpstreamPathTemplate": "/gateway/Order",
"UpstreamHttpMethod": [ "GET", "PUT", "POST" ]
}
]
}
Gateway.Program.cs
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddJsonFile("ocelot.json");
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddOcelot();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseOcelot().Wait();
app.UseAuthorization();
app.MapControllers();
app.Run();
I'm missing something but can't figure out what it is, I have checked the downstream path and upstream path. I would be grateful for any help
