app.route('/clientes')
.get(verificaAutenticacao, controller.listaClientes, controller.listaRegionais);
When I do this only 1 controller is called what is wrong?
app.route('/clientes')
.get(verificaAutenticacao, controller.listaClientes, controller.listaRegionais);
When I do this only 1 controller is called what is wrong?
if what you're talking about is nodejs express and you're trying to add multiple middlewares to a route you should use the following syntax:
app.get('/example/b', function (req, res, next) {
console.log('the response will be sent by the next function ...')
next()
}, function (req, res) {
res.send('Hello from B!')
})
I resolved the problem...
I'm new in Express, Angular and mongo so after looking and search some logic i found the answer.
When I make a route.get and pass middleware I need create a new path, which refers about that function middleware.