Permalink
Browse files

Middleware folder can be passed through options.midDir

  • Loading branch information...
1 parent dd8e7af commit 6c9a7432a47596c012dfe1f0160b39ec4aaa636e @rodnic committed Oct 24, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/mojito.js
View
@@ -199,6 +199,11 @@ MojitoServer.prototype._configureAppInstance = function(app, options) {
if (!options.context) {
options.context = {};
}
+ if (!options.midDir) {
+ options.midDir = 'middleware';
+ }
+
+
// all logging that comes from YUI comes from here
// We need to do this early, since creating a Y instance appears to copy
@@ -394,7 +399,7 @@ MojitoServer.prototype._configureAppInstance = function(app, options) {
} else {
// backwards-compatibility: user-provided middleware is
// specified by path
- midPath = libpath.join(options.dir, 'middleware', midName);
+ midPath = libpath.join(options.dir, options.midDir, midName);
//console.log("======== MIDDLEWARE user " + midPath);
midBase = libpath.basename(midPath);
if (0 === midBase.indexOf('mojito-')) {

0 comments on commit 6c9a743

Please sign in to comment.