Is the koa2 path data correct or 404?

koa2 path data is correct or 404
and await is not allowed in the function. Without await, you can

router.prefix("/post")

router.get("/list",Post.list);
exports.list = async(ctx, next)=>{
    let keyword,query,result=[];

    if( ctx.query.keyword){
       keyword = ctx.query.keyword; 
       query = Post.find({
        $or:[{
            title: /.*${keyword}.*/i,
            body: /.*${keyword}.*/i
        }]
        },
        "title category tags createAt updateAt _id");
    }else{
         query = Post.find({},"title category tags createAt updateAt  _id");
    }
    
    
    result= await dbHelper.Exec(query);   
    console.log(`result:${result}`)//
    ctx.body = result; //  ctx.response.body = result;
    console.log(ctx) // 

}

Aug.16,2021

simplify other code and try the following 404?

const Router = require('koa-router');
const router = new Router({prefix:'/post'});

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

it's strange to add await next () to a middleware. Does this middleware add await to something that doesn't provide me with the next service?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ebb826-48640.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ebb826-48640.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?