Permalink
Browse files

Added support for multiple routes to one handler

  • Loading branch information...
1 parent c4a7f6a commit 0ee26286fedcdb6a9938435794aaca793ea43099 @baryshev committed Jul 13, 2012
Showing with 6 additions and 3 deletions.
  1. +5 −2 lib/connect-route.js
  2. +1 −1 package.json
@@ -5,8 +5,11 @@ var
createMethodHandler = function (method) {
method = method.toUpperCase();
- return function (route, handler) {
- this.add(method, route, handler);
+ return function () {
+ var i;
+ for (i = 0; i < arguments.length - 1; i++) {
+ this.add(method, arguments[i], arguments[arguments.length - 1]);
+ }
};
},
View
@@ -1,6 +1,6 @@
{
"name" : "connect-route",
- "version" : "0.1.0",
+ "version" : "0.1.1",
"description" : "Simple and fast router for Connect",
"keywords": [ "router", "connect" ],
"author" : "Vadim M. Baryshev <vadimbaryshev@gmail.com>",

0 comments on commit 0ee2628

Please sign in to comment.