Permalink
Browse files

Add a comment explaining what is passed to custom middleware when it …

…is first loaded.
  • Loading branch information...
1 parent 720a5f0 commit 7c3586a81ae183ca99ac4fcd9a996f904b4a107a @ricallinson ricallinson committed Apr 20, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 source/lib/index.js
View
@@ -283,6 +283,16 @@ MojitoServer.prototype = {
midPath = libpath.join(__dirname, 'middleware', midName);
//console.log("======== MIDDLEWARE mojito " + midPath);
midFactory = require(midPath);
+ // We assume the middleware is a factory function
+ // and pass in the following config object when
+ // calling said function.
+ //
+ // midConfig = {
+ // Y: Y,
+ // store: store,
+ // logger: logger,
+ // context: options.context
+ // };
app.use(midFactory(midConfig));
}
} else {

0 comments on commit 7c3586a

Please sign in to comment.