- Notifications
You must be signed in to change notification settings - Fork0
http://node-organic.com/ DNA loader, depending onhttps://www.npmjs.com/package/config
License
camplight/cell-dna
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
You should be familiar withhttp://node-organic.com/ if you want to use this DNA loader.
This specific DNA loader assuming you're having adna
folder outside ofnode_modules
. It may have the following structure:
dna├── default.js├── development.js├── secrets.js├── staging.js└── test.js
In order to load specific DNA be sure to start your process with corresponding NODE_ENV.development
is default DNA. Example usage:
$ NODE_ENV=staging node index.js // starts your process by using development.js DNA$ NODE_ENV=test node index.js // starts your process by using staging.js DNA
Be sure to check outhttps://github.com/lorenwest/node-config/wiki/Configuration-Files to better understand how to organize your cell DNA folder.
You can also add secrets.js inside your DNA folder (be sure to gitignore them ;)) and load them using the helper methodd:
constloadSecrets=require('cell-dna/load-secrets')const_=require('lodash')// optional dependency for your project, use whatever you like for deep copymodule.exports=_.merge({},loadSecrets(),{port:process.env.PORT||3001,database:{url:'http://localhost:8529',name:'local-db',},})
About
http://node-organic.com/ DNA loader, depending onhttps://www.npmjs.com/package/config