-
-
Save anonymous/aa4a684441f018b31303 to your computer and use it in GitHub Desktop.
Gist created using https://github.com/niftylettuce/gedit-gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ## Load Schemas | |
exports.bootSchemas = function(app, db) { | |
var files = [] | |
, dir = path.join(__dirname, 'schemas') | |
, walker = walk.walk(dir, { followLinks: false }); | |
walker.on('file', function(root, stat, next) { | |
files.push(path.join(root, stat.name)); | |
next(); | |
}); | |
walker.on('end', function() { | |
files.forEach(function(file) { | |
require(file)(db); | |
console.log(file); | |
console.log(db.models); | |
}); | |
// Always keep this last | |
exports.bootApplication(app, db); | |
exports.bootRoutes(app, db); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment