Allow for any HTTP verb on device command

This commit is contained in:
deadprogram 2013-11-15 00:45:06 -08:00
parent 87671c1427
commit d1799c1761
2 changed files with 2 additions and 2 deletions

2
dist/api.js vendored
View File

@ -79,7 +79,7 @@
return res.json(err ? err : device.data().commands);
});
});
this.server.post("/robots/:robot/devices/:device/commands/:command", function(req, res) {
this.server.all("/robots/:robot/devices/:device/commands/:command", function(req, res) {
var commandid, deviceid, key, params, robotid, value, _ref;
params = [req.params.robot, req.params.device, req.params.command];
robotid = params[0], deviceid = params[1], commandid = params[2];

View File

@ -56,7 +56,7 @@ namespace "Api", ->
master.findRobotDevice robotid, deviceid, (err, device) ->
res.json if err then err else device.data().commands
@server.post "/robots/:robot/devices/:device/commands/:command", (req, res) ->
@server.all "/robots/:robot/devices/:device/commands/:command", (req, res) ->
params = [req.params.robot, req.params.device, req.params.command]
[robotid, deviceid, commandid] = params