title: Using dynamicHelpers in routes setup with Express and node.js
body: <p>I began using node.js+express combo very recently and I stumbled at a need to use dynamicHelpers not only in my views but also inside my routes setup (routes/index.js in default express config). Should I use some different pattern?</p>
  
  <p>app.js</p>
  
  <pre><code>app.dynamicHelpers({
      translate : function(req, res) {
          return translate;
      },
      language : function(req, res) {
          return req.session.language || "en";
      },
  });
  </code></pre>
  
  <p>Below I would like to have a convenient access to whatever I set for my dynamicHelpers because in my mind it is the same context .. so why set it up two times?</p>
  
  <pre><code>var routes = {};
  routes.index = function(req, res) {
      res.render('index', {
          title : 'My webpage',
          categories : categoryPositions,
          referrer : req.header("Referrer"),
          languages : ["pl", "en", "de"],
          &lt;----- here I would like to use my dynamicHelpers (for example translate)
      })
  };
  </code></pre>
  
  <p>I know I can pass my data in many ways but I do not want to repeat my code
  and want to set up the common context only once and as cleanly as polssible. I welcome any criticism and good advice!</p>