title: Using routes in Express-js
body: <p>So I'm starting to use Node.js. I saw the video with Ryan Dahl on <a href="http://nodejs.org/" rel="noreferrer">Nodejs.org</a> and heard he recommended Express-js for websites.</p>
  
  <p>I downloaded the latest version of Express, and began to code. I have a fully fledged static view up on /, but as soon as I try sending parameters, I get errors like this:</p>
  
  <pre><code>Cannot GET /wiki
  </code></pre>
  
  <p>I tried following the guide on <a href="http://expressjs.com/" rel="noreferrer">expressjs.com</a> but the way one uses routes has changed in the latest version, which makes the guide unusable.</p>
  
  <p>Guide:</p>
  
  <pre><code>app.get('/users/:id?', function(req, res, next){
      var id = req.params.id;
      if (id) {
          // do something
      } else {
          next();
      }
  });
  </code></pre>
  
  <p>Generated by Express:</p>
  
  <pre><code>app.get('/', routes.index);
  </code></pre>
  
  <p>My problem arises when I try and add another route.</p>
  
  <pre><code>app.get('/wiki', routes.wiki_show);
  </code></pre>
  
  <p>I've tried a bunch of approaches, but I keep getting the <code>Cannot GET /wiki</code> (404) error.</p>
  
  <p>routes/index.js looks like this:</p>
  
  <pre><code>exports.index = function(req, res) {
      res.render('index', { title: 'Test', articles: articles, current_article: current_article, sections: sections })
  };
  </code></pre>
  
  <p>The only thing I did there was add some parameters (arrays in the same file) and this i working. But when I copy the contents and change <code>exports.index</code> to <code>exports.wiki</code> or <code>exports.wiki_show</code> I still get the <code>Cannot GET /wiki</code> error.</p>
  
  <p>Can anyone explain to me what I'm missing here? - Thanks.</p>