This is a tutorial for connecting to Node.js using the c-treeEDGE Node.js module. For more about the FairCom support for Node.js, see FairCom Node.js Support in the on-line documentation.
This Node.js module has a dependency on Python 2.7.
This Node.js module is included with your c-treeACE or c-treeEDGE download. Look for the restapi.nodejs folder in the sdk folder.
Using the command line, create and then change into a new folder.
Issue the following command, adapting it to the location of your restapi.nodejs folder:
npm install C:\path\to\restapi.nodejs
Note: You may be required to update to the latest npm version. (For example, many Raspberry Pi Raspbian devices come pre-installed with an old version.) npm is easily updated as followed: > sudo npm install -g npm@latest
The module currently contains 5 methods:
Basic usage of the module starts with the following two lines:
fields: an object containing the fields and search values as keys and values respectively.
callback: a callback function that will be called with two parameters once the query is executed: err and res. If err is false, the query was executed successfully and the res object contains the query search result.