]>
git.r.bdr.sh - rbdr/forum/blob - config/config.js
32f27aff9ed0e340e7e2c87b99c489d3f8c803f9
1 import Getenv
from 'getenv2';
5 * The main configuration object for the Forum backend. It will be used to
6 * initialize all of the sub-components. It can extend any property of
9 * @typedef {object} tForumBackendConfiguration
10 * @property {number} [port=1978] the port where the app will listen on
11 * @property {string} [staticDirectory=static] the path, relative to the
12 * project root, where static assets live
13 * @property {number} [ttl=180] the time in seconds that posts
15 * @property {tRethinkDBConfiguration} rethinkDB the configuration to
16 * connect to the rethinkDB server
17 * @property {tJWTConfiguration} jwt the configuration for the
21 port: Getenv('FORUM_PORT', Joi
.number().integer(), 1978),
22 staticDirectory: Getenv('FORUM_STATIC_DIRECTORY', Joi
.string(), 'static'),
23 ttl: Getenv('FORUM_TTL', Joi
.number().integer(), 180),
26 * Configures the behavior of the JWT token.
28 * @typedef {object} tJWTConfiguration
29 * @property {number} [duration=86400] the duration of the JWT in
31 * @property {string} secret the secret used to sign the JWT
34 duration: Getenv('FORUM_JWT_DURATION', Joi
.number().integer(), 86400),
35 secret: Getenv('FORUM_JWT_SECRET', Joi
.string())
39 * Information required to connect to the rethinkDB server
41 * @typedef {object} tRethinkDBConfiguration
42 * @property {string} host the location of the rethinkDB host
43 * @property {string} [post=6379] port where rethinkDB server is listening
46 host: Getenv('FORUM_RETHINK_DB_HOST', Joi
.string()),
47 port: Getenv('FORUM_RETHINK_DB_PORT', Joi
.number().integer(), 28015)