Merge branch 'master' of github.com:kennethreitz/responder

This commit is contained in:
2018-10-27 05:13:39 -04:00
+4 -6
View File
@@ -313,11 +313,9 @@ class API:
except Exception:
self.default_response(req, resp, error=True)
raise
# Then on_get.
# Then run on_method.
method = req.method
# Run on_request first.
try:
# Run the view.
r = getattr(view, f"on_{method}", self.no_response)(
@@ -341,7 +339,7 @@ class API:
return resp
def add_event_handler(self, event_type, handler):
"""Add a event handler to the API.
"""Adds an event handler to the API.
:param event_type: A string in ("startup", "shutdown")
:param handler: The function to run. Can be either a function or a coroutine.
@@ -359,7 +357,7 @@ class API:
check_existing=True,
websocket=False,
):
"""Add a route to the API.
"""Adds a route to the API.
:param route: A string representation of the route.
:param endpoint: The endpoint for the route -- can be a callable, or a class.