Allow for any HTTP verb on device command
This commit is contained in:
parent
87671c1427
commit
d1799c1761
|
@ -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];
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue