Skip to content

Commit

Permalink
#537 added configuration switch for dispatch enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
itayw committed Jun 10, 2014
1 parent 67c482c commit c1bdf69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions config/default.yml
@@ -1,4 +1,4 @@
version: 0.0.200
version: 0.0.310
interfaces:
webserver:
enabled: true
Expand Down Expand Up @@ -63,7 +63,8 @@ store:
dsn: mongodb://localhost:27017/cache
expireafterseconds: 0
dispatch:
expires: 60
enabled: true
expires: 60
authentication:
basicauth:
enabled: false
Expand Down
1 change: 0 additions & 1 deletion lib/joola.io.js
Expand Up @@ -31,7 +31,6 @@ joola.init = function (options, callback) {
//setup the stack
joola.common = require('./common/index');
joola.options = joola.common.extend({
localRoute: true,
webserver: false,
logger: {
console: {
Expand Down
3 changes: 2 additions & 1 deletion lib/webserver/routes/index.js
Expand Up @@ -290,9 +290,10 @@ exports.router = function (req, res, next) {
action.run.apply(this, args);
};

var useLocalRoute = !joola.config.get('dispatch:enabled');
if (action && action._route)
return action._route(req, res);
else if (joola.options.localRoute)
else if (useLocalRoute)
return localRoute(req, res);
else
return dispatchRoute(req, res);
Expand Down

0 comments on commit c1bdf69

Please sign in to comment.