Permalink
Browse files

updated for dolce

  • Loading branch information...
1 parent 7811ce0 commit beafa52a76c5439d5eec143bbcf5e0d828716df9 @crcn crcn committed Jan 28, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/index.js
View
@@ -31,9 +31,9 @@ module.exports = function() {
crema(typeOrObj).forEach(function(route) {
- if(_routes.contains(route.channel.paths, route.channel.tags)) throw new Error('Route ' + crema.stringifyPaths(route.channel.paths) + ' already exists');
+ if(_routes.contains(route.channel, route.channel.tags)) throw new Error('Route ' + crema.stringifyPaths(route.channel.paths) + ' already exists');
- _routes.addRoute(route, callback);
+ _routes.add(route, callback);
});
@@ -105,7 +105,7 @@ module.exports = function() {
return function(req, res, next) {
//on request, fetch the route by url, and method. TODO: make it a bit more flexible with $or
- var route = _routes.get(req.url, { method: req.method });
+ var route = _routes.get(crema.parseChannel(req.url), { method: req.method });
//route chain does not exist? 404'd
if(!route.chains.length) return _404(req, res);

0 comments on commit beafa52

Please sign in to comment.