Open micosty opened 8 years ago
should I upgrade to koa2?
your current version is v1? or v2?
i had tried koa v1.2.2 & v2.0.0, node version v0.12.5 & v5.7.1. All report same error: "app.use() requires a generator function"
I got the same error just use as silmple example......
app.use(livereload());
Error:
assert.js:90
throw new assert.AssertionError({
^
koa version is
"koa": "^1.2.0",
It looks like u`d better write like this:
// return (ctx, next) => next().then(() => {
return function*(next) {
var ctx = this;
yield next;
...
...
...
//});
};
I have tried like this,and it doesn't report error.
It looks like koa -v1 doesn't support the way of promise?I don`t know...
app.use(livereload());
assert.js:89 throw new assert.AssertionError({ ^ AssertionError: app.use() requires a generator function