In your plugins init method you can do
var helpers = module.parent.require('./routes/helpers');
myPlugin.init = function(params, callback) {
helpers.setupPageRoute(params.app, '/', params.middleware, [], myCustomHome);
callback();
};
function myCustomHome(req, res, next) {
async.parallel({
categories: function(next) {
Categories.getAllCategories();
}
topics: function(next) {
Topics.getLatestTopics();
}
}, function(err, results) {
res.render('myCustomTemplate', results);
});
}
I left out some of the params for the 2 methods you mentioned. Let me know if you can't figure it out.