Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename the delete verb to del so that it works with normal dot access…

… in javascript
  • Loading branch information...
commit b0b795eea80646b503f1daacc461498c918e2ef6 1 parent 51eb313
Timothy Caswell authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 http_server.js
View
4 http_server.js
@@ -31,7 +31,7 @@ exports.put = function (pattern, handler) {
return addRoute("PUT", pattern, handler);
};
-exports['delete'] = function (pattern, handler) {
+exports.del = function (pattern, handler) {
return addRoute("DELETE", pattern, handler);
};
@@ -40,7 +40,7 @@ exports.resource = function (name, controller) {
exports.get(new RegExp('^/' + name + '/([^/]+)$'), controller.show);
exports.post(new RegExp('^/' + name + '$'), controller.create);
exports.put(new RegExp('^/' + name + '/([^/]+)$'), controller.update);
- exports['delete'](new RegExp('^/' + name + '/([^/]+)$'), controller.destroy);
+ exports.del(new RegExp('^/' + name + '/([^/]+)$'), controller.destroy);
};
exports.resourceController = function (name, data, on_change) {
Please sign in to comment.
Something went wrong with that request. Please try again.