I have a number of middleware functions similar to the following:
function validate(req, res, next) { req.validationError = new Error(\'invalid\'); } func
try with following code
app.use('/', [validate, checkValid,respond]);
OR
var middleware = [validate, checkValid,respond]; app.use('/', middleware );
Need to placed all function in that series as your requirement of execution.
Thanks