title: understanding modules/routes in nodejs
body: <p>I'm new in nodejs. I want to build a rest service with multiple, lets say, categories.</p>
  
  <pre><code>&gt; app.js 
  var express = require('express')
    , http = require('http')
    , routes = require('./routes')
    , path = require('path');
  
  app = express();
  app.use(app.router);
  
  app.get('*',routes.index);
  
  app.listen(3000);
  console.log('Express app started on port 3000');
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&gt; routes/index.js
  var sites = [
      'sve',
      'ice'
  ];
  
  exports.index = function(req,res){
      var url = req.url.split('/');
      for (i in sites) {
          app.get('/' + sites[i] + '/*',require('./' + sites[i]));
      }
  };  
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&gt; routes/sve/index.js
  module.exports = function(req, res){
    console.log('sve')
    res.end({category:'sve'});
  };
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&gt; routes/sve/index.js
  module.exports = function(req, res){
    console.log('sve')
    res.end({category:'sve'});
  };
  </code></pre>
  
  <p>when I run "node app" I get "Express app started on port 3000" and the server is running but when I access "localhost:3000/sve/test" I have no response or "localhost:3000/ice/test" or even "localhost:3000/abc/test".
  Not even in the console.</p>
  
  <p>What am I doing wrong?</p>