const upload = multer ({ dest: path})
I have: router.post('/uploadUserImage', upload.any(), api.uploadUserImage);
How i convert this in Nest ??
You can hook into the express instance. I'm guessing you'd probably want to create a middleware wrapper for it.
Hi @franciscoffavaro,
Just return upload.any()
in resolve()
method of Nest middleware.
@Middleware()
export class MulterMiddleware implements NestMiddleware {
resolve(): (req, res, next) => void {
const upload = multer({ dest: path });
return upload.any();
}
}
@kamilmysliwiec I think a call to next()
is missing
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi @franciscoffavaro,
Just return
upload.any()
inresolve()
method of Nest middleware.