A configuration POC (proof-of-concept) to demonstrate a strategy to store but not track application configurations
such as database connection settings and user credentials. These settings are saved in an .apprc
but not tracked
in Git. The .apprc-sample
file is included to represent application settings.
The import.js
application uses the rc node module to load and parse the .apprc
configuration file. rc will parse either INI and JSON
formatted files. A INI file format is used in this example.
The import.js
will default to development, if no NODE_ENV is set. Set your environment variable to alter the behavior.
This sample application imports United States state data from a JSON file into a MySQL database. A MySQL server connection is required.
cp .apprc-sample .apprc
- Edit
.apprc
- Add your settings
$ npm install
$ node import
$ NODE_ENV=test node import