Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

no built-in constraints

  • Loading branch information...
commit 4857bff9d72ce247d9dd274f89631a1d5cfeef4c 1 parent cc69234
@cloudhead authored
Showing with 4 additions and 18 deletions.
  1. +1 −15 lib/journey.js
  2. +3 −3 test/journey-test.js
View
16 lib/journey.js
@@ -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
6 test/journey-test.js
@@ -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) });
Please sign in to comment.
Something went wrong with that request. Please try again.