Note: Some FairCom releases ship without the plug-ins installed. To make the three REST tutorials work in those products, you must un-zip winX64\bin\ace\sql\plugins.exe, uncomment PLUGIN cthttpd... in the ctsrvr.cfg file, and then restart the c-tree server.
To install the Node-RED REST API, follow these steps:
sudo npm install -g --unsafe-perm node-red
Windows users can try typing node-red from a command shell.
On Windows, this is usually the following folder: C:\Users\my_name\.node-red
On Linux, this is usually the following folder: ~\.node-red
If this folder is missing, you might have to start and stop Node-RED once.
npm --prefix . install <path to node-red-contrib-ctree folder>
In the example above, the path to the node-red-contrib-ctree folder is typically drivers\node-red.rest.crud\node-red-contrib-ctree, starting from your FairCom product install folder. The first time you run this command, it will download packages, so be sure your computer is connected to the Internet.
Do not install the node-red-contrib-ctree-ctrl node.
On Windows, this will make a node-red-contrib-ctree item appear in your C:\Users\my_name\.node-red\node_modules folder.
The URL usually should be similar to: http://localhost:1880
You should now see a new node, called "ctree", under the "storage" section. For information on using the node, see the sections below.
If the "ctree" node is not present, exit Node-RED, delete the "node-red-contrib-ctree" item your C:\Users\my_name\.node-red\node_modules folder (Windows), or from your ~\.node-red\node_modules folder (Linux). Then return to step 4 (above) and re-issue the "install" command.
For more information, see the Node-RED chapter in the FairCom Edge Developers Guide and the REST API Developer's Guide.
Note: If you are using a self-signed certificate, Node-RED may reject the connection because it is considered unauthorized and Node-RED will show a SELF_SIGNED_CERT_IN_CHAIN error on the console. To work around this, set the NODE_TLS_REJECT_UNAUTHORIZED environment variable to 0, and restart Node-RED.
Example for Unix:
$ export NODE_TLS_REJECT_UNAUTHORIZED=0
$ node red.js -v push2omnibus.json