]>
git.r.bdr.sh - rbdr/dasein/blob - config/config.js
3 const Getenv
= require('getenv');
8 * The main configuration object for Dasein. It will be used to
9 * initialize all of the sub-components. It can extend any property of
13 * @typedef {object} tConfiguration
14 * @property {number} [port=1927] the port where the app will listen on
15 * @property {string} [staticDirectory=static] the path, relative to the
16 * project root, where static assets live
17 * @property {number} [ttl=180] the time in seconds that posts
19 * @property {Dasein.tRedisConfiguration} redis the configuration to
20 * connect to the redis server
21 * @property {Dasein.tJWTConfiguration} jwt the configuration for the
23 * @property {Dasein.tTwitterConfiguration} twitter the configuration
24 * for twitter integration
26 module
.exports
= internals
.Config
= {
27 port: Getenv
.int('DASEIN_PORT', 1927),
28 staticDirectory: Getenv('DASEIN_STATIC_DIRECTORY', 'static'),
29 ttl: Getenv
.int('DASEIN_TTL', 180),
32 * Configures the behavior of the JWT token.
35 * @typedef {object} tJWTConfiguration
36 * @property {number} [duration=86400] the duration of the JWT in
38 * @property {string} secret the secret used to sign the JWT
41 duration: Getenv
.int('DASEIN_JWT_DURATION', 86400),
42 secret: Getenv('DASEIN_JWT_SECRET')
46 * Information required to connect to the redis server
49 * @typedef {object} tRedisConfiguration
50 * @property {string} host the location of the redis host
51 * @property {string} [post=6379] port where redis server is listening
54 host: Getenv('DASEIN_REDIS_HOST'),
55 port: Getenv
.int('DASEIN_REDIS_PORT', 6379)
59 * Configures the twitter integration values
62 * @typedef {object} tTwitterConfiguration
63 * @property {string} consumerKey The consumer key used to authenticate
64 * with the twitter API
65 * @property {string} consumerSecret the consumer secret used to
66 * authenticate with the twitter API
69 consumerKey: Getenv('DASEIN_TWITTER_CONSUMER_KEY'),
70 consumerSecret: Getenv('DASEIN_TWITTER_CONSUMER_SECRET')