title: NodeJS cannot find custom module
body: <p>I am trying to export a module to my routes file.</p>
  
  <p>My file tree goes like</p>
  
  <pre><code>routes.js
  app.js
  controllers/users.js
              posts.js
  </code></pre>
  
  <p>on my <code>app.js</code> I exported <code>var route = require('./routes');</code> and that works.
  now on my <code>routes.js</code> I tried to export <code>require('./controllers');</code>.</p>
  
  <p>But it keeps telling me that it <code>cannot find module controllers</code>.</p>
  
  <p>Doing this works:</p>
  
  <pre><code>require('./controllers/users')
  </code></pre>
  
  <p>But I am trying to follow expressjs sample initial projects format.
  And it is bugging me because the example of <code>expressjs</code> shows: (express routes is a folder)</p>
  
  <pre><code>var routes = require('./routes');
  </code></pre>
  
  <p>and loads it like </p>
  
  <pre><code>app.get('/', routes.index);
  </code></pre>
  
  <p>with no error. and that <code>./routes</code> is a folder. I am just following the same principle.</p>