-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
43 lines (38 loc) · 962 Bytes
/
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
const dotenv = require('dotenv');
const asserts = require('assert');
dotenv.config();
const {
HOST,
PORT,
SQL_USER,
SQL_PASSWORD,
SQL_DATABASE,
SQL_SERVER,
SQL_PORT,
JWT_KEY,
} = process.env;
const sqlEncrypt = process.env.SQL_ENCRYPT === 'true';
asserts(HOST, 'HOST is required');
asserts(PORT, 'PORT is required');
asserts(SQL_USER, 'SQL_USER is required');
asserts(SQL_PASSWORD, 'SQL_PASSWORD is required');
asserts(SQL_DATABASE, 'SQL_DATABASE is required');
asserts(SQL_SERVER, 'SQL_SERVER is required');
asserts(SQL_PORT, 'SQL_PORT is required');
asserts(JWT_KEY, 'JWT_KEY is required');
module.exports = {
host: HOST,
port: PORT,
sql: {
user: SQL_USER,
password: SQL_PASSWORD,
database: SQL_DATABASE,
server: SQL_SERVER,
port: SQL_PORT,
options: {
encrypt: sqlEncrypt,
enableArithAbort: true,
},
},
jwtKey: JWT_KEY,
};