When to use next() and return next() in Node.js

前端 未结 5 2019
执念已碎
执念已碎 2020-11-30 17:07

Scenario: Consider the following is the part of code from a node web app.

app.get(\'/users/:id?\', function(req, res, next){
    var id = re         


        
5条回答
  •  臣服心动
    2020-11-30 17:58

    Next() :

    Calling this function invokes the next middleware function in the app. The next() function is not a part of the Node.js or Express API, but is the third argument that is passed to the middleware function.

提交回复
热议问题