Closed dong-lufei closed 12 months ago
First of all, I just want to mention that Koa isn't tested against deno by the maintainers as far as I know so bugs might occur even though technically it "should just work" :)
But the reason this has unexpected response is because of this middleware:
// 中间件2
app.use(async function (_req, _res, _next) {
console.log(2)
await delay(1000)
console.log(3)
})
That's not a function signature supported by Koa. Also there's nothing in that middleware calling next so logically the request isn't expected to reach your router (which is added to the middleware chain after said middleware).
I am going to assume this is either solved or stale, and so I will close this ticket. If you still have questions feel free to re-open this ticket!
deno run -A mod.js http://localhost:1993 1 2 3 4 GET / - 1053ms
The page responds with 404 Not Found