Advertisement
Guest User

Untitled

a guest
May 24th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. beforeActions : [
  2. {
  3. before : [
  4. '_loadUser', // This has to be the name of a method that exists in the same controller
  5. function(req, res, next) { // This is just a custom middleware
  6. res.locals.hi = 'hi';
  7. next()
  8. },
  9. neonode.controllers['Home']._authenticate // This is a method from another controller
  10. ],
  11. actions : ['show', 'edit', 'update', 'destroy']
  12. },
  13. {
  14. before : [function(req, res, next) { // This is another before action that will run after all the previous ones.
  15. req.user = res.locals.user
  16. next();
  17. }],
  18. actions : ['show']
  19. }
  20. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement