How does async/await block in koa?

problem description

needs the output result to be 1
blocking execution before output 3, waiting for 2

related codes

/ / Please paste the code text below (do not replace the code with pictures)

const Koa = require("koa");
const app = new Koa();
app.use(async (ctx, next) => {
    console.log(1);
    await next()
    console.log(3);
});
app.use(async (ctx, next) => {
    setTimeout(() => {
        console.log(2);
    }, 2000);
});
app.listen(3001);
console.log("http://localhost:3001")

what result do you expect? What is the error message actually seen?

expect to output in the order of 1, 2, 3

Sep.29,2021

const Koa = require("koa");
const app = new Koa();
app.use(async (ctx, next) => {
    console.log(1);
    await next()
    console.log(3);
});
app.use(async (ctx, next) => {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
          console.log(2);
          resolve();
        }, 2000);
    })
});
app.listen(3001);
console.log('http://localhost:3001')
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-1b30b27-340e4.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-1b30b27-340e4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?