Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function includeRouter(folderName) {
- fs.readdirSync(folderName).forEach(function(file) {
- var fullName = path.join(folderName, file);
- var stat = fs.lstatSync(fullName);
- if (stat.isDirectory()) {
- includeRouter(fullName);
- } else if (file.toLowerCase().indexOf('.js')) {
- require('./' + fullName)(app);
- console.log("require('" + fullName + "')");
- }
- });
- }
- includeRouter('router');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement