Skip to content

Commit

Permalink
Symmetric aliases for get & put.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 18, 2012
1 parent 6796e23 commit 499a0d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/cube/server/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ var endpoint = require("./endpoint"),
util = require("util");

exports.register = function(db, endpoints) {
var putter = require("./event").putter(db);
var putter = require("./event").putter(db),
poster = post(putter);
endpoints.ws.push(
endpoint.exact("/1.0/event/put", putter)
);
endpoints.http.push(
endpoint.exact("POST", "/1.0/event/put", post(putter)),
endpoint.exact("POST", "/1.0/event", poster),
endpoint.exact("POST", "/1.0/event/put", poster),
endpoint.exact("POST", "/collectd", require("./collectd").putter(putter))
);
};
Expand Down
3 changes: 2 additions & 1 deletion lib/cube/server/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ exports.register = function(db, endpoints) {
endpoint.exact("/1.0/metric/get", metric)
);
endpoints.http.push(
endpoint.exact("GET", "/1.0/metric", metricGet)
endpoint.exact("GET", "/1.0/metric", metricGet),
endpoint.exact("GET", "/1.0/metric/get", metricGet)
);

function metricGet(request, response) {
Expand Down

0 comments on commit 499a0d0

Please sign in to comment.