-
Notifications
You must be signed in to change notification settings - Fork 10
/
env.config.js
47 lines (42 loc) · 993 Bytes
/
env.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* 앱에서 사용하는 환경변수를 설정하는 파일입니다.
*
* @author BounceCode, Inc.
* @packageDocumentation
*/
require('dotenv').config();
let certs = null;
try {
certs = require('./config/certs.config');
} catch (e) {
throw new Error(
'Please generate config/certs.config.js file using `npm run certs`',
);
}
let dbconfig = {};
try {
dbconfig = require('./config/db.config');
} catch (e) {}
const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test';
if (isTest) {
dbconfig = {
// dropSchema: true,
logging: false,
};
}
module.exports = {
PORT: process.env.PORT || 8080,
DEV: isDev,
CERT_PUBLIC: certs.PUBLIC,
CERT_PRIVATE: certs.PRIVATE,
DATABASE: {
type: process.env.DB_TYPE,
host: process.env.DB_HOST,
port: process.env.DB_PORT,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
...dbconfig,
},
};