Merge pull request #164 from taoufik07/patch-12

Fix typo
This commit is contained in:
2018-10-27 04:51:34 -04:00
committed by GitHub
+4 -6
View File
@@ -315,11 +315,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)(
@@ -343,7 +341,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.
@@ -361,7 +359,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.