Skip to content

Instantly share code, notes, and snippets.

@ozzyr
Created August 15, 2018 16:34
Show Gist options
  • Save ozzyr/8699c992e7f6dde03bd9ce33c32dc599 to your computer and use it in GitHub Desktop.
Save ozzyr/8699c992e7f6dde03bd9ce33c32dc599 to your computer and use it in GitHub Desktop.
const fs = require('fs');
const path = require('path');
module.exports = app => {
fs
.readdirSync(__dirname)
.filter(file => ((file.indexOf('.')) !== 0 && (file !== "index.js")))
.forEach(file => require(path.resolve(__dirname, file))(app));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment