-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Middleware #51
Comments
I'm open to that: def add_middleware(self, middleware_class, **options):
self.middleware.append(middleware_class(self, **options)) |
Also useful here - Starlette's |
Hey, any idea how to turn on debug mode in Responder? |
@ajitid it doesn't have it yet :) |
Run it using
|
Didn't knew this, and got confused. |
Supporting ASGI middleware would be a really good way to compartmentalise away bits of complexity, as we all promoting more of a cross-framework ecosystem.
I'd suggest an interface of
app.add_middleware(cls, **options)
We could then do things like:
Response
, and useStarlette
's GzipMiddleware, which will also take care of handling streaming responses (once responder has those)CORSMiddleware
.We can set up a default set of middleware if needed based on the configuration options presented to the
API(...)
class.Any objections or considerations?
The text was updated successfully, but these errors were encountered: