Remove old un-finished ./config/*.json configuration files and implement a new functionality based on node-config module: https://npmjs.org/package/config
Configuration file will contain all required settings for all modules
Load config file from app.js and propagate the info from modules initialization function (only 1st module loads the data from file)
Create 3 sets of config files for each system:
default.json: to run with /dev/null (printer basic emulation)
linux.json (set to /dev/ttyACM0 - to be used with rPi)
macosx.json (to test on laptop over /dev/tty.usbmodem621)
When launching webapp 'node app.js' it will run with the default.json config file.
To set an alternative just type:
$ export NODE_ENV=linux
$ node app.js
or
$ export NODE_ENV=macosx
$ node app.js
To create your own config file just clone the default.json, rename it to a specific NAME and then export that name before launching app.js.
Remove old un-finished ./config/*.json configuration files and implement a new functionality based on node-config module: https://npmjs.org/package/config
When launching webapp 'node app.js' it will run with the default.json config file. To set an alternative just type:
or
To create your own config file just clone the default.json, rename it to a specific NAME and then export that name before launching app.js.