From 625865412fa939d7c9e11257a5b37e1ca73dc152 Mon Sep 17 00:00:00 2001 From: lixxu Date: Fri, 17 Mar 2017 13:12:17 +0800 Subject: [PATCH 1/2] update function name as it not halt request actually --- docs/sanic/blueprints.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sanic/blueprints.md b/docs/sanic/blueprints.md index 4b704422..5fe20e54 100644 --- a/docs/sanic/blueprints.md +++ b/docs/sanic/blueprints.md @@ -66,7 +66,7 @@ Using blueprints allows you to also register middleware globally. ```python @bp.middleware -async def halt_request(request): +async def print_on_request(request): print("I am a spy") @bp.middleware('request') @@ -116,7 +116,7 @@ bp = Blueprint('my_blueprint') async def setup_connection(app, loop): global database database = mysql.connect(host='127.0.0.1'...) - + @bp.listener('after_server_stop') async def close_connection(app, loop): await database.close() @@ -142,7 +142,7 @@ blueprint_v2 = Blueprint('v2', url_prefix='/v2') @blueprint_v1.route('/') async def api_v1_root(request): return text('Welcome to version 1 of our documentation') - + @blueprint_v2.route('/') async def api_v2_root(request): return text('Welcome to version 2 of our documentation') From 94c83c445fd067934052733853d81af5abd7f193 Mon Sep 17 00:00:00 2001 From: lixxu Date: Fri, 17 Mar 2017 14:01:54 +0800 Subject: [PATCH 2/2] fix broken table --- docs/sanic/config.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/sanic/config.md b/docs/sanic/config.md index f5d56467..0c22de4b 100644 --- a/docs/sanic/config.md +++ b/docs/sanic/config.md @@ -71,8 +71,7 @@ DB_USER = 'appuser' Out of the box there are just a few predefined values which can be overwritten when creating the application. -| Variable | Default | Description | -| ----------------- | --------- | --------------------------------- | -| REQUEST_MAX_SIZE | 100000000 | How big a request may be (bytes) | -| REQUEST_TIMEOUT | 60 | How long a request can take (sec) | - + | Variable | Default | Description | + | ----------------- | --------- | --------------------------------- | + | REQUEST_MAX_SIZE | 100000000 | How big a request may be (bytes) | + | REQUEST_TIMEOUT | 60 | How long a request can take (sec) |