docs: A middleware is always responsible for calling downstream (#978)

Irrespective of whether it is called by an upstream middleware or not.
master
designgrill 2017-06-13 00:08:25 +05:30 committed by jongleberry
parent 0a7856ca15
commit beec26ebf8
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@
## Writing Middleware
Koa middleware are simple functions which return a `MiddlewareFunction` with signature (ctx, next). When
the middleware is run by an "upstream" middleware, it must manually invoke `next()` to run the "downstream" middleware.
the middleware is run, it must manually invoke `next()` to run the "downstream" middleware.
For example if you wanted to track how long it takes for a request to propagate through Koa by adding an
`X-Response-Time` header field the middleware would look like the following: