Skip to content

Commit

Permalink
Join the * onto the namespace manually to support home routes which d…
Browse files Browse the repository at this point in the history
…on't end in '/'


e.g. app.namespace('/user', middleware, function(){});

middleware should now be called for '/user' as well as '/user/'.
  • Loading branch information
ForbesLindesay committed Apr 12, 2012
1 parent 05e41aa commit 5c76ef6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions index.js
Expand Up @@ -28,12 +28,8 @@ exports.namespace = function(){
, path = args.shift() , path = args.shift()
, fn = args.pop() , fn = args.pop()
, self = this; , self = this;
self.all(path + '*', args);
(this._ns = this._ns || []).push(path); (this._ns = this._ns || []).push(path);

if(args.length){
self.all('/*', args);
}

fn.call(this); fn.call(this);
this._ns.pop(); this._ns.pop();
return this; return this;
Expand Down

0 comments on commit 5c76ef6

Please sign in to comment.