Skip to content

gurunate/config-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

config-poc

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.

Setup

Configure the .apprc file

  1. cp .apprc-sample .apprc
  2. Edit .apprc
  3. Add your settings

Install dependencies

$ npm install

Run

$ node import

Testing a different NODE_ENV

$ NODE_ENV=test node import

References

About

A configuration storage strategy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published