ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.24k stars 1.62k forks source link

Error Code: UnableToFindDownstreamRouteError (404) #2108

Closed ldc999 closed 3 weeks ago

ldc999 commented 3 weeks ago

Hi,I encountered a tricky problem and need help.

Steps to Reproduce the Problem

1.I referred to the doucement page and established the following project code as shown in the image. image 2.Then, I tried to request the interface, but the response was 404. However, if I comment out app.UseOcelot().Wait();, it is accessible

image

  1. And VisualStdio Console output: Ocelot.DownstreamRouteFinder.Middleware.DownstreamRouteFinderMiddleware: Warning: requestId: 0HN4G6KHG2BGO:00000002, previousRequestId: No PreviousRequestId, message: 'DownstreamRouteFinderMiddleware setting pipeline errors. IDownstreamRouteFinder returned Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /WeatherForecast, verb: GET.' Ocelot.Responder.Middleware.ResponderMiddleware: Warning: requestId: 0HN4G6KHG2BGO:00000002, previousRequestId: No PreviousRequestId, message: 'Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /WeatherForecast, verb: GET. errors found in ResponderMiddleware. Setting error response for request path:/WeatherForecast, request method: GET'

    • Version: Ocelot V23.3.3
    • Platform:.NET8
    • Subsystem:Windows
raman-m commented 3 weeks ago

🤣