diff --git a/responder/api.py b/responder/api.py index 00a95e9..9c130a1 100644 --- a/responder/api.py +++ b/responder/api.py @@ -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.