Remove trailing whitespace
This commit is contained in:
parent
f6fda0efbc
commit
204bf89685
|
@ -24,7 +24,7 @@ namespace("Cylon", function() {
|
||||||
// name - name of the Adaptor, used when printing to console
|
// name - name of the Adaptor, used when printing to console
|
||||||
// connection - Connection the adaptor will use to proxy commands/events
|
// connection - Connection the adaptor will use to proxy commands/events
|
||||||
//
|
//
|
||||||
// Returns a new Adaptor
|
// Returns a new Adaptor
|
||||||
function Adaptor(opts) {
|
function Adaptor(opts) {
|
||||||
if (opts == null) {
|
if (opts == null) {
|
||||||
opts = {};
|
opts = {};
|
||||||
|
|
22
lib/api.js
22
lib/api.js
|
@ -72,19 +72,19 @@ namespace("Cylon", function() {
|
||||||
return _results;
|
return _results;
|
||||||
})());
|
})());
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.get("/robots/:robotname", function(req, res) {
|
this.server.get("/robots/:robotname", function(req, res) {
|
||||||
return master.findRobot(req.params.robotname, function(err, robot) {
|
return master.findRobot(req.params.robotname, function(err, robot) {
|
||||||
return res.json(err ? err : robot.data());
|
return res.json(err ? err : robot.data());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.get("/robots/:robotname/commands", function(req, res) {
|
this.server.get("/robots/:robotname/commands", function(req, res) {
|
||||||
return master.findRobot(req.params.robotname, function(err, robot) {
|
return master.findRobot(req.params.robotname, function(err, robot) {
|
||||||
return res.json(err ? err : robot.data().commands);
|
return res.json(err ? err : robot.data().commands);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.all("/robots/:robotname/commands/:commandname", function(req, res) {
|
this.server.all("/robots/:robotname/commands/:commandname", function(req, res) {
|
||||||
var params;
|
var params;
|
||||||
params = _this.parseCommandParams(req);
|
params = _this.parseCommandParams(req);
|
||||||
|
@ -99,13 +99,13 @@ namespace("Cylon", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.get("/robots/:robotname/devices", function(req, res) {
|
this.server.get("/robots/:robotname/devices", function(req, res) {
|
||||||
return master.findRobot(req.params.robotname, function(err, robot) {
|
return master.findRobot(req.params.robotname, function(err, robot) {
|
||||||
return res.json(err ? err : robot.data().devices);
|
return res.json(err ? err : robot.data().devices);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.get("/robots/:robotname/devices/:devicename", function(req, res) {
|
this.server.get("/robots/:robotname/devices/:devicename", function(req, res) {
|
||||||
var devicename, robotname, _ref;
|
var devicename, robotname, _ref;
|
||||||
_ref = [req.params.robotname, req.params.devicename], robotname = _ref[0], devicename = _ref[1];
|
_ref = [req.params.robotname, req.params.devicename], robotname = _ref[0], devicename = _ref[1];
|
||||||
|
@ -113,7 +113,7 @@ namespace("Cylon", function() {
|
||||||
return res.json(err ? err : device.data());
|
return res.json(err ? err : device.data());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.get("/robots/:robotname/devices/:devicename/commands", function(req, res) {
|
this.server.get("/robots/:robotname/devices/:devicename/commands", function(req, res) {
|
||||||
var devicename, robotname, _ref;
|
var devicename, robotname, _ref;
|
||||||
_ref = [req.params.robotname, req.params.devicename], robotname = _ref[0], devicename = _ref[1];
|
_ref = [req.params.robotname, req.params.devicename], robotname = _ref[0], devicename = _ref[1];
|
||||||
|
@ -121,7 +121,7 @@ namespace("Cylon", function() {
|
||||||
return res.json(err ? err : device.data().commands);
|
return res.json(err ? err : device.data().commands);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.all("/robots/:robot/devices/:device/commands/:commandname", function(req, res) {
|
this.server.all("/robots/:robot/devices/:device/commands/:commandname", function(req, res) {
|
||||||
var commandname, devicename, params, robotname;
|
var commandname, devicename, params, robotname;
|
||||||
params = [req.params.robot, req.params.device, req.params.commandname];
|
params = [req.params.robot, req.params.device, req.params.commandname];
|
||||||
|
@ -138,13 +138,13 @@ namespace("Cylon", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.get("/robots/:robotname/connections", function(req, res) {
|
this.server.get("/robots/:robotname/connections", function(req, res) {
|
||||||
return master.findRobot(req.params.robotname, function(err, robot) {
|
return master.findRobot(req.params.robotname, function(err, robot) {
|
||||||
return res.json(err ? err : robot.data().connections);
|
return res.json(err ? err : robot.data().connections);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.get("/robots/:robot/connections/:connection", function(req, res) {
|
this.server.get("/robots/:robot/connections/:connection", function(req, res) {
|
||||||
var connectionname, robotname, _ref;
|
var connectionname, robotname, _ref;
|
||||||
_ref = [req.params.robot, req.params.connection], robotname = _ref[0], connectionname = _ref[1];
|
_ref = [req.params.robot, req.params.connection], robotname = _ref[0], connectionname = _ref[1];
|
||||||
|
@ -152,11 +152,11 @@ namespace("Cylon", function() {
|
||||||
return res.json(err ? err : connection.data());
|
return res.json(err ? err : connection.data());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.server.get("/robots/:robotname/devices/:devicename/events", function(req, res) {
|
this.server.get("/robots/:robotname/devices/:devicename/events", function(req, res) {
|
||||||
return req.io.route('events');
|
return req.io.route('events');
|
||||||
});
|
});
|
||||||
|
|
||||||
return this.server.io.route('events', function(req) {
|
return this.server.io.route('events', function(req) {
|
||||||
var devicename, robotname, _ref;
|
var devicename, robotname, _ref;
|
||||||
_ref = [req.params.robotname, req.params.devicename], robotname = _ref[0], devicename = _ref[1];
|
_ref = [req.params.robotname, req.params.devicename], robotname = _ref[0], devicename = _ref[1];
|
||||||
|
|
Loading…
Reference in New Issue