FastAPI - Middleware and Hooks
You wrote this middleware but it does not run for any requests:
What is the likely problem?
class MyMiddleware:
async def dispatch(self, request, call_next):
print("Middleware active")
response = await call_next(request)
return response
app = FastAPI()
app.add_middleware(MyMiddleware)What is the likely problem?
