How To

Create a new node api

Api deals with creating new node using as parameter the workspace's token, by associating it to the node (each node has to be associated at least to a workspace) and the user's token for the identification.
Api returns a status code or a configuration json.

Status code

  1. 401 Unauthorized: the user's token used as parameter is not associated with any user or is not authorized to doing this operation.
  2. 500 Internal Server Error: generic error returned by server.

Usage examples

The setting of a node can be done in two ways:

  1. By choosing a distribution which, through a curl call, runs a script using this api
    $ curl -s '' \
           | bash -s {user_token} {workspace_token}
  2. Manual setting in which are listed all the steps:
    1. clone of the repository
    2. download of the configuration file
    $ git clone '' &&
    $ cd stormnode &&
    $ node -e "require('https').get('{user_token}&allow_remote_update=1&team={workspace_token}', f => {f.pipe(require('fs').createWriteStream('stormnode.json'));});" &&
    $ npm install --production