What function are arguments available to Express JS route handlers?

Posted by Jennifer | Updated on

What function are arguments available to Express JS route handlers?

The arguments which are available to an Express JS route handler-function are:

  • Req: the request object
  • Res: the response object
  • Next (optional): a function that is employed to pass management to 1 of the following route handlers.

The third argument is optional and should be omitted, however, in some cases, it’s helpful wherever there’s a series of handlers and management will be passed to 1 of the following route handlers skipping this one.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers