Merge pull request #35 from narzeja/master
Documentation improvement for blueprints
This commit is contained in:
commit
66b40c4188
|
@ -56,7 +56,9 @@ In this example, the registered routes in the `app.router` will look like:
|
||||||
```
|
```
|
||||||
|
|
||||||
## Middleware
|
## Middleware
|
||||||
Blueprints must be registered with the application.
|
Using blueprints allows you to also register middleware exclusively for that
|
||||||
|
blueprint, without interfering with other blueprints or routes registered
|
||||||
|
directly on the application object.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
@bp.middleware
|
@bp.middleware
|
||||||
|
@ -73,7 +75,8 @@ async def halt_response(request, response):
|
||||||
```
|
```
|
||||||
|
|
||||||
## Exceptions
|
## Exceptions
|
||||||
Blueprints must be registered with the application.
|
Exceptions can also be applied exclusively to blueprints without interfering
|
||||||
|
with other blueprints or routes registered on the application object.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
@bp.exception(NotFound)
|
@bp.exception(NotFound)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user