0
import dbConnect from '../../lib/mongodb';
import Job from '../../models/Job';
import multer from 'multer';
import nextConnect from 'next-connect';
import fs from 'fs';
import path from 'path';

const upload = multer({ dest: '/tmp' });

const apiRoute = nextConnect({
onError(error, req, res) {
res.status(501).json({ error: `Sorry something happened! ${error.message}` });
},
onNoMatch(req, res) {
res.status(405).json({ error: `Method '${req.method}' Not Allowed` });
},
});

Showing me this error: (Error) How can i solve this issue?

I have tried downloading next-connect multiple times but nothing works, is it some version issue or what, i dont know.

1

0

Browse other questions tagged or ask your own question.