我正在做:
const audioResource = finale.resource({
model: db.models.Audio,
endpoints: ['/audios', '/audios/:id']
})
audioResource.use(multer().single("file"))
audioResource.use(resources.audio)
在哪里resources.audio
:
module.exports = {
create: {
write: {
before: (req, res, context) => {
console.log(Object.keys(req))
console.log(req.body)
console.log("HERE I AM!")
console.log(req.file)
}
}
}
}
但是,我无法访问req.file
. 是否可以使用 multer 中间件进行设置?