INNER CODE UNIT · Python
add_route
falconry/falcon · falcon/app.py:621
def add_route(self, uri_template: str, resource: object, **kwargs: Any) -> None:
"""Associate a templatized URI path with a resource.
Falcon routes incoming requests to resources based on a set of
URI templates. If the path requested by the client matches the
template for a given route, the request is then passed on to the
associated resource for processing.
Note:
If no route matches the request, control then passes to a default
responder that simply raises an instance of
:class:`~.HTTPRouteNotFound`. By default, this error will be
rendered as a 404 response, but this behavior can be modified by
adding a custom error handler (see also
:ref:`this FAQ topic <faq_override_404_500_handlers>`).
On the other hand, if a route is matched but the resource does not