-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
32 lines (23 loc) · 1.17 KB
/
config.js
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
const env = process.env;
const config = {
portOrSocket: env.DOC_FEEDBACK_HANDLERS_PORT || env.port || 8090,
pathPrefix: env.DOC_FEEDBACK_PATH_PREFIX || 'doc-feedback',
// sessionSecret: 'FEEDBACK_REPLACE_ME_WITH_RANDOM_STRING',
// langs: env.DOC_FEEDBACK_LANGS ? env.DOC_FEEDBACK_LANGS.split(',') : ['ru', 'en'],
// defaultLang: env.DOC_FEEDBACK_DEFAULT_LANG || 'ru',
// ghAPI: 'https://api.github.com'
};
let secretConfig;
try {
secretConfig = require('./secret-config');
} catch (err) {
console.error('No "secret-config.js" file found...');
}
const resultConfig = Object.assign({}, secretConfig, config);
// resultConfig.github || (resultConfig.github = {});
// env.DOC_FEEDBACK_TOKENS && (resultConfig.github.tokens = env.DOC_FEEDBACK_TOKENS.split(','));
// env.DOC_FEEDBACK_CLIENT_ID && (resultConfig.github.clientID = env.DOC_FEEDBACK_CLIENT_ID);
// env.DOC_FEEDBACK_CLIENT_SECRET && (resultConfig.github.clientSecret = env.DOC_FEEDBACK_CLIENT_SECRET);
// resultConfig.github.authCallbackSite = env.DOC_FEEDBACK_AUTH_CALLBACK_SITE || '';
env.DOC_FEEDBACK_MONGO_URL && (resultConfig.mongo = env.DOC_FEEDBACK_MONGO_URL);
module.exports = resultConfig;