Closed mikestecker closed 2 years ago
This is because next.js does not provide request.is
function. You can try adding a middleware before that route like so:
handler.use((req, res, next) => {
req.is = (ctype) => req.headers['content-type'].includes(ctype)
next()
})
@mikestecker This is my middleware:
(req, res, next) => {
req.is = (ctype) => !!req.headers?.['content-type']?.includes(ctype);
next();
},
How do you use this with graphql-upload?
I tried putting in
.use(graphqlUploadExpress({ maxFileSize: 10000, maxFiles: 10 }))
per their docs, but I'm receiving this error: