Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- beforeActions : [
- {
- before : [
- '_loadUser', // This has to be the name of a method that exists in the same controller
- function(req, res, next) { // This is just a custom middleware
- res.locals.hi = 'hi';
- next()
- },
- neonode.controllers['Home']._authenticate // This is a method from another controller
- ],
- actions : ['show', 'edit', 'update', 'destroy']
- },
- {
- before : [function(req, res, next) { // This is another before action that will run after all the previous ones.
- req.user = res.locals.user
- next();
- }],
- actions : ['show']
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement