Permalink
Browse files

no built-in constraints

  • Loading branch information...
1 parent cc69234 commit 4857bff9d72ce247d9dd274f89631a1d5cfeef4c @cloudhead committed Jan 31, 2011
Showing with 4 additions and 18 deletions.
  1. +1 −15 lib/journey.js
  2. +3 −3 test/journey-test.js
View
@@ -232,21 +232,7 @@ journey.Router.prototype = {
return promise;
},
- constraints: {
- //
- // Check if the request has a non-empty body
- //
- payload: function (payload, request, body) {
- return Boolean(body) === payload;
- },
-
- //
- // Run a function, and check return value
- //
- assert: function (assert, request, body) {
- return Boolean(assert(request, body));
- }
- },
+ constraints: {},
resolve: function (request, body, dispatcher) {
var that = this, allowedMethods = [];
View
@@ -63,11 +63,11 @@ var router = new(journey.Router)(function (map) {
bind(function (res, r) { return resources[r].index(res) });
map.route('GET', /^(\w+)\/([0-9]+)$/).
bind(function (res, r, k) { return resources[r].get(res, k) });
- map.route('PUT', /^(\w+)\/([0-9]+)$/, { payload: true }).
+ map.route('PUT', /^(\w+)\/([0-9]+)$/).
bind(function (res, r, k) { return resources[r].update(res, k) });
- map.route('POST', /^tuple$/, { payload: true }).
+ map.route('POST', /^tuple$/).
bind(function (res, doc) { return resources.tuple(res, doc) });
- map.route('POST', /^(\w+)$/, { payload: true }).
+ map.route('POST', /^(\w+)$/).
bind(function (res, r, doc) { return resources[r].create(res, doc) });
map.route('DELETE', /^(\w+)\/([0-9]+)$/).
bind(function (res, r, k) { return resources[r].destroy(res, k) });

0 comments on commit 4857bff

Please sign in to comment.