Created
February 10, 2014 00:48
-
-
Save ajeeshpu/8908454 to your computer and use it in GitHub Desktop.
hooking a helper function for express to be used in views
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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