function(req, res, next)
is callback function. It’s supposed to be called somewhere else, not in this snippet. In case of Express it’s called by Express itself on a request with respective arguments, req, res, next
.
CLICK HERE to find out more related problems solutions.