Skip to content

Instantly share code, notes, and snippets.

@psychobunny
Last active August 29, 2015 13:56
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 psychobunny/9297940 to your computer and use it in GitHub Desktop.
Save psychobunny/9297940 to your computer and use it in GitHub Desktop.
webserver.js middlewares
async.series({
currentThemeData: function(next) {
db.getObjectFields('config', ['theme:type', 'theme:id', 'theme:staticDir', 'theme:templates'], function(err, themeData) {
next(err, themeData);
});
},
themesData: function(next) {
meta.themes.get(function(err, themes) {
next(err, themes);
});
}
}, function(err, data) {
middleware(app, data);
if (err) {
winston.error('Errors were encountered while attempting to initialise NodeBB.');
process.exit();
} else {
if (process.env.NODE_ENV === 'development') {
winston.info('Middlewares loaded.');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment