node-express error : express deprecated res.send(status): Use res.sendStatus(status) instead

前端 未结 7 997
甜味超标
甜味超标 2020-12-09 09:22

I am trying to send an integer via response.send() but I keep getting this error

express deprecated res.send(status): Use res.sendStatus

7条回答
  •  鱼传尺愫
    2020-12-09 09:32

    You could try this:

    res.status(200).send((results[0].id).toString());
    

    Guys are right - it doesn't allow numbers. Prooflink: http://expressjs.com/4x/api.html#res.send

提交回复
热议问题