title: Using D3.js with NodeJs and Express
body: <p>I am following this tutorial on NodeJs and Express <a href="http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/" rel="nofollow">http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/</a>. </p>
  
  <p>I need to display bar charts using D3 for data visualisation. I made some changes in app.'s file :</p>
  
  <pre><code>var d3 = require('d3');
  app.get('/d3', routes.d3);
  </code></pre>
  
  <p>Added these lines to route/index.js:</p>
  
  <pre><code>exports.helloworld = function(req, res){
    res.render('d3');
  };
  </code></pre>
  
  <p>Added a new file to views directory: d3.html containing code from index.html from this link
  <a href="http://bl.ocks.org/mbostock/3885304" rel="nofollow">http://bl.ocks.org/mbostock/3885304</a>
  and added data.tsv from same link.</p>
  
  <p>I get this error:</p>
  
  <pre><code>/nodetest1/node_modules/express/lib/router/index.js:291
      throw new Error(msg);
            ^
  Error: .get() requires callback functions but got a [object Undefined]
      at 
  /nodetest1/node_modules/express/lib/router/index.js:291:11
      at Array.forEach (native)
      at Router.route 
  (/nodetest1/node_modules/express/lib/router/index.js:287:13)
      at Router.(anonymous function) [as get] (/nodetest1/node_modules/express/lib/router/index.js:318:16)
      at Function.app.(anonymous function) [as get] (/nodetest1/node_modules/express/lib/application.js:412:26)
      at Object.&lt;anonymous&gt; (/nodetest1/app.js:38:5)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
  </code></pre>