Skip to content

Commit

Permalink
Merge pull request #557 from hpincket/patch-1
Browse files Browse the repository at this point in the history
docs(tutorial): note depreciation of global hooks
  • Loading branch information
kgriffs committed Jul 14, 2015
2 parents 7331d5d + 3101063 commit 5826468
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions doc/user/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,7 @@ responders in a DRY way, e.g.,:
params['project_id'] = req.get_header('X-PROJECT-ID')
Now, you can imagine that such a hook should apply to all responders for
a resource, or even globally to all resources. You can apply hooks to an
entire resource like so:
a resource. You can apply hooks to an entire resource like so:

.. code:: python
Expand All @@ -558,12 +557,8 @@ entire resource like so:
# ...
And you can apply hooks globally by passing them into the API class
initializer:

.. code:: python
falcon.API(before=[extract_project_id])
Similar logic can be applied globally with middleware.
(See :ref:`falcon.middleware <middleware>`)

To learn more about hooks, take a look at the docstring for the ``API`` class,
as well the docstrings for the ``falcon.before`` and ``falcon.after`` decorators.
Expand Down

0 comments on commit 5826468

Please sign in to comment.