diff --git a/dist/api.js b/dist/api.js index 3d6d406..8ad6313 100644 --- a/dist/api.js +++ b/dist/api.js @@ -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]; diff --git a/src/api.coffee b/src/api.coffee index 87d75f3..addb07c 100644 --- a/src/api.coffee +++ b/src/api.coffee @@ -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