I'm playing around with Matador and there are a few places where the documentation on the github project page doesn't match the current implementation (or, I'm doing it wrong).
e.g. Adding a before filter:
module.exports = function (app, config) {
return app.controllers.Base.extend(function() {
this.addBeforeFilter(this.requireAuth);
}).methods({
requireAuth: function(callback) {
return callback(null);
}
});
}
Gives me the following error:
TypeError: object is not a function
at IncomingMessage.CALL_NON_FUNCTION (native)
at /Users/taylorr/Code/myapp/app/controllers/ApplicationController.js:7:14
at callbacks (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:272:11)
at param (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:246:11)
at pass (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:253:5)
at Router._dispatch (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:280:4)
at Object.handle (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:45:10)
at next (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/node_modules/connect/lib/http.js:204:15)
at next (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/node_modules/connect/lib/http.js:206:9)
at Object.methodOverride [as handle] (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:35:5)
Can you help me out here?
I'm playing around with Matador and there are a few places where the documentation on the github project page doesn't match the current implementation (or, I'm doing it wrong).
e.g. Adding a before filter:
Gives me the following error:
Can you help me out here?