Running the application
Tim S edited this page Jan 13, 2017
·
5 revisions
The application is a node.js app, so it must be invoked via node:
cd src
node index.js
Invoking it in this manner will cause the application load the config file named config.json
that resides in the same directory as index.js
and will use all default settings.
To refine the execution of the application, the following command line parameters are supported:
- /showConfig - displays the config file in the console after processing the queries
- /showOutput - log template output to the console, requires log level >= info
- /debugAPI - trace API information from the PureCloud API
- /loglevel=<level> - (default: verbose) enables logging up to and including the specified level: error < warning < info < debug < verbose
- /config=<path> - (default: ./config.json) path to the config file to load. Relative paths provided here will be resolved relative to the location of index.js.
- /jobs=<job,names> - comma separated list of jobs to execute immediately
- /clientId=<client ID> - Overrides the PureCloud OAuth client ID in the config file
- /clientSecret=<client secret> - Overrides the PureCloud OAuth client secret in the config file
See /src/examples/run.sh for examples of how to invoke each example configuration.
For example, to use a custom config file, run two jobs, debug the API, and use credentials stored in environment variables, run the application with this command:
cd src
node index.js /config=/path/to/myconfig.json /jobs=job1,job2 /debugapi /clientId=$CLIENT_ID /clientSecret=$CLIENT_SECRET