res.json(obj, status)

Express 5 不再支持签名 res.json(obj, status)。而是,设置状态,然后将其链接到 res.json() 方法,如下所示:res.status(status).json(obj)

Express 5 no longer supports the signature res.json(obj, status). Instead, set the status and then chain it to the res.json() method like this: res.status(status).json(obj).