I have seen the following example:
https://stackoverflow.com/questions/13133071/express-next-function-what-is-it-really-for
which has three get
methods with the same signature: app.get('/user/:id', function (req, res, next)
. I want to follow up on the answer but unfortunately, I do not have enough 'reputation' to add a comment.
My question is how does ExpressJS knows which method/middleware to execute next when the next() function is called? Is it the order of appearance of the get methods in the source code?