How To Connect with the HTTP API

Cylon's HTTP API plugin can be used to interact with your robots remotely.

To use it, install it alongside Cylon:

$ npm install cylon-api-http

Running your robot:

The following code example will spin up an API server:

var Cylon = require('cylon');

Cylon.api('http');

Cylon.robot({
  connections: {
    loopback: { adaptor: 'loopback' }
  },

  devices: {
    ping: { driver: 'ping' }
  },

  work: function() {
  }
}).start();

By default, an unconfigured API instance will listen on https://127.0.0.1:3000, using a self-signed cert and with no authentication.

For more information API configuration, see the configuration page.

For more information on available API routes, check out the CPPP-IO spec that Cylon's API follows.