Beginner to koa, using ctx in app.use to directly return the html string can be displayed, but when using fs.readFile and assigning data to ctx.body in the callback, not found is displayed on the browser. What should I do? How to write it, I couldn’t find
ReadFile directly is asynchronous, right? Use readFileSync?
Or refer to this?
koa-sendfile
koa
好像没有直接类似express
的res.sendFile()
Such syntax requires adding middleware