aboutsummaryrefslogtreecommitdiff
path: root/config/config.js
blob: b1a1fac1fd7f5da09c06a3fb92d2456b5225ef11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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)
  }
};