diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/config.js | 35 | ||||
| -rw-r--r-- | config/env.dist | 2 | ||||
| -rw-r--r-- | config/jsdoc.json | 9 |
3 files changed, 46 insertions, 0 deletions
diff --git a/config/config.js b/config/config.js new file mode 100644 index 0000000..b1a1fac --- /dev/null +++ b/config/config.js @@ -0,0 +1,35 @@ +'use strict'; + +const Getenv = require('getenv'); + +const internals = {}; + +/** + * The main configuration object for Dead Drop. It will be used to + * initialize all of the sub-components. It can extend any property of + * the dead drop object. + * + * @memberof DeadDrop + * @typedef {object} tConfiguration + * @property {number} [port=1988] the port where the app will listen on + * @property {string} twilioAccountSid the twilio account sid used to authorize calls + * @property {DeadDrop.tRedisConfiguration} redis the configuration to + * connect to the redis server + */ +module.exports = internals.Config = { + port: Getenv.int('DEAD_DROP_PORT', 1988), + twilioAccountSid: Getenv('DEAD_DROP_TWILIO_ACCOUNT_SID'), + + /** + * Information required to connect to the redis server + * + * @memberof DeadDrop + * @typedef {object} tRedisConfiguration + * @property {string} host the location of the redis host + * @property {string} [post=6379] port where redis server is listening + */ + redis: { + host: Getenv('DEAD_DROP_REDIS_HOST'), + port: Getenv.int('DEAD_DROP_REDIS_PORT', 6379) + } +}; diff --git a/config/env.dist b/config/env.dist new file mode 100644 index 0000000..5686169 --- /dev/null +++ b/config/env.dist @@ -0,0 +1,2 @@ +DEAD_DROP_REDIS_HOST=location_of_redis_server +DEAD_DROP_TWILIO_ACCOUNT_SID=your_twilio_account_sid diff --git a/config/jsdoc.json b/config/jsdoc.json new file mode 100644 index 0000000..9e05753 --- /dev/null +++ b/config/jsdoc.json @@ -0,0 +1,9 @@ +{ + "plugins": ["plugins/markdown"], + "opts": { + "destination": "doc", + "readme": "README.md", + "template": "node_modules/docdash", + "recurse": true + } +} |