Mounted WSGIMiddleware to "/" in fastapi #51
-
My situation is the following. First I have an apirouter that has the path What then happens is that for any route I try that should reach the wsgi app I get a 404 that has the standard fastapi 404 error. If I reverse the order, mount the wsgi middleware first, and then add the fastapi routes the wsgi app works as expected, but the fastapi routes are swallowed by the So the order should be first define fastapi routes, then the wsgi app, but I can't for the life of me understand why the routing doesn't reach the mounted wsgi app. Is there a good way of resolving this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Answering my own issue. I was using uvicorn.run with a string, and so used an app factory, in that app factory, the mount route was not included. |
Beta Was this translation helpful? Give feedback.
Answering my own issue. I was using uvicorn.run with a string, and so used an app factory, in that app factory, the mount route was not included.