Express4中文文档
Express 5 不再支持签名 res.send(status),其中 status 是一个数字。而是使用 res.sendStatus(statusCode) 函数,该函数设置 HTTP 响应标头状态代码并发送代码的文本版本:"Not Found"、"Internal Server Error" 等。如果您需要使用 res.send() 函数发送数字,请引用该数字以将其转换为字符串,以便 Express 不会将其解释为尝试使用不受支持的旧签名。
res.send(status)
status
res.sendStatus(statusCode)
res.send()