Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Created November 23, 2014 14:28
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 geobabbler/d1dc7fd047dd2659f8b3 to your computer and use it in GitHub Desktop.
Save geobabbler/d1dc7fd047dd2659f8b3 to your computer and use it in GitHub Desktop.
// dynamically include routes (Controller)
fs.readdirSync('./controllers').forEach(function (file) {
if(file.substr(-3) == '.js') {
route = require('./controllers/' + file);
route.controller(app);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment