How can I send a success status to browser from nodejs/express?

前端 未结 4 1408
南笙
南笙 2021-02-02 05:13

I\'ve written the following piece of code in my nodeJS/Expressjs server:

app.post(\'/settings\', function(req, res){
    var myData = {
        a: req.param(\'a\         


        
4条回答
  •  -上瘾入骨i
    2021-02-02 05:44

    Express Update 2015:

    Use this instead:

    res.sendStatus(200)
    

    This has been deprecated:

    res.send(200)  
    

提交回复
热议问题