版权声明:程序员小鱼 https://blog.csdn.net/u012664888/article/details/77516078
根据错误提示,koa2需要使用 new 示例的demo代码改为:
var koa = require('koa2');
var app = new koa();
app.use(function *(){
this.body = 'Hello World';
});
app.listen(3000);
根据错误提示,koa2需要使用 new 示例的demo代码改为:
var koa = require('koa2');
var app = new koa();
app.use(function *(){
this.body = 'Hello World';
});
app.listen(3000);