You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get this error message when trying to configure ocelot programmatically
Ocelot.Responder.Middleware.ResponderMiddleware[0]
requestId: 0HN8B1C7OOUES:00000001, previousRequestId: No PreviousRequestId, message: 'Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /banks, verb: GET. errors found in ResponderMiddleware. Setting error response for request path:/banks, request method: GET'
This is my code
using System.Security.Claims;
using Microsoft.AspNetCore.Mvc.Filters;
using Ocelot.Configuration.File;
using Ocelot.Configuration.Repository;
public class Middleware : IMiddleware
{
private readonly IFileConfigurationRepository _fileConfigurationRepository;
public Middleware(IFileConfigurationRepository fileConfigurationRepository)
{
_fileConfigurationRepository = fileConfigurationRepository;
}
private List<FileRoute> Configuration(string downStreamPathTemplate)
{
}
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
var fileConfig = new FileConfiguration
{
Routes = new List<FileRoute>
{
new FileRoute
{
DownstreamPathTemplate = "/api/bank/banks",
DownstreamScheme = "https",
DownstreamHostAndPorts = new List<FileHostAndPort>
{
new FileHostAndPort { Host = "google.com", Port = 443 }
},
DownstreamHttpMethod = "GET",
UpstreamPathTemplate = "/banks",
UpstreamHttpMethod = new List<string> { "GET" }
}
},
GlobalConfiguration = new FileGlobalConfiguration
{
BaseUrl = "https://localhost:7174"
}
};
await _fileConfigurationRepository.Set(fileConfig);
await next.Invoke(context);
}
}
I get this error message when trying to configure ocelot programmatically
This is my code
This is my program.cs
The text was updated successfully, but these errors were encountered: