From 5c76ef6c49a4567ac203346502192c4b17c65191 Mon Sep 17 00:00:00 2001 From: Forbes Lindesay Date: Thu, 12 Apr 2012 18:11:06 +0200 Subject: [PATCH] Join the * onto the namespace manually to support home routes which don't end in '/' e.g. app.namespace('/user', middleware, function(){}); middleware should now be called for '/user' as well as '/user/'. --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index 5f049fb..0ffab61 100644 --- a/index.js +++ b/index.js @@ -28,12 +28,8 @@ exports.namespace = function(){ , path = args.shift() , fn = args.pop() , self = this; + self.all(path + '*', args); (this._ns = this._ns || []).push(path); - - if(args.length){ - self.all('/*', args); - } - fn.call(this); this._ns.pop(); return this;