search

Home  >  Q&A  >  body text

node.js - nodejs express的一个问题

router.get('/', **function(req, res, next)** {    
    res.send('Hello aumalls s')
  //res.render('index', { title: 'Express' });
});

这后面的回调函数function(req,res,next){}
里面的参数是怎么肯定的,有几个参数,顺度是什么?这个我们怎么知道?

巴扎黑巴扎黑2786 days ago370

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 16:07:07

    A request object, a response object, and a next (if the function code in the callback is executed, you can enter the next middleware through next, otherwise it will always be in a suspended state), please refer to the official website demo for details

    reply
    0
  • Cancelreply