koa引入koa-router之后 ctx.body报错

koa引入koa-router之后 ctx.body报错

const koa = require('koa');
const Router = require('koa-router');
let server = new koa();
let router= new Router();

router.get('/test',async (ctx,next)=>{ 
  ctx.body('ok');
})

server.use(router.routes())

server.listen(8080);

以上代码运行会报错 ** ctx.body is not a function** ,这是为什么?

koa版本 2.7.0 koa-router版本 7.4.0

本人刚刚接触koa,大神勿喷

ctx不是一个函数,应该使用 ctx.body = "ok"