Skip to content

Instantly share code, notes, and snippets.

@tmpvar
Forked from anonymous/app.js
Created September 25, 2010 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmpvar/596480 to your computer and use it in GitHub Desktop.
Save tmpvar/596480 to your computer and use it in GitHub Desktop.
var controllers = {};
fs.readdir(__dirname + '/controllers', function(err, files){
if (err) throw err;
files.forEach(function(file){
var controller = file.replace('.js','');
controllers[controller] = require('./controllers/' + controller);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment