commit
291c7c329f
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ module.exports = class Application extends Emitter {
|
||||||
|
|
||||||
use(fn) {
|
use(fn) {
|
||||||
if (typeof fn !== 'function') throw new TypeError('middleware must be a function!');
|
if (typeof fn !== 'function') throw new TypeError('middleware must be a function!');
|
||||||
if (isGeneratorFunction(fn)) throw new TypeError('Support for generators has been removed. See the documentation for examples of how to convert old middleware https://github.com/koajs/koa#example-with-old-signature');
|
if (isGeneratorFunction(fn)) throw new TypeError('Support for generators has been removed. See the documentation for examples of how to convert old middleware https://github.com/koajs/koa/tree/v2.x#old-signature-middleware-v1x');
|
||||||
debug('use %s', fn._name || fn.name || '-');
|
debug('use %s', fn._name || fn.name || '-');
|
||||||
this.middleware.push(fn);
|
this.middleware.push(fn);
|
||||||
return this;
|
return this;
|
||||||
|
|
Loading…
Reference in a new issue