Skip to content

Instantly share code, notes, and snippets.

@ajeeshpu
Created February 10, 2014 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajeeshpu/8908454 to your computer and use it in GitHub Desktop.
Save ajeeshpu/8908454 to your computer and use it in GitHub Desktop.
hooking a helper function for express to be used in views
var moment= require('moment')
module.exports = {
// Init custom express middleware
express: {
customMiddleware: function (app) {
app.locals.currentYear=function(){
return moment().get('year')
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment