I am creating this api endpoint called pincode.js in Nextjs:
export default function handler(req, res) {
res.status.json([234400, 721302, 110003, 560017]);
}
but it is giving the error : res.status.json() is not a function How to handle this?
I am creating this api endpoint called pincode.js in Nextjs:
export default function handler(req, res) {
res.status.json([234400, 721302, 110003, 560017]);
}
but it is giving the error : res.status.json() is not a function How to handle this?
status is a function that expects a status code, you should call or omit it.
passing status 200 to it:
omit status code, and send default one (200, if I'm not mistaken):