Skip to content

Instantly share code, notes, and snippets.

/settings.js Secret

Created January 2, 2012 06:16
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 anonymous/aa4a684441f018b31303 to your computer and use it in GitHub Desktop.
Save anonymous/aa4a684441f018b31303 to your computer and use it in GitHub Desktop.
// ## 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