-
Notifications
You must be signed in to change notification settings - Fork 0
/
configs.js
58 lines (50 loc) · 1.13 KB
/
configs.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
48
49
50
51
52
53
54
55
56
57
58
import dotenv from 'dotenv';
dotenv.config();
async function envenHandler({ code, message }) {
if (code === 0) {
console.error(message);
// TODO : wait some seconds (send alerts to our ALTELIER SERVERS alert HOOKS) before EXIT
process.exit(code);
}
}
process.on('uncaughtException', (err) => {
const event = {
code: 1,
message: `\n\n ${err.message}\n ${err.stack}`,
};
envenHandler(event);
});
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled rejection at promise:');
console.error(promise);
console.error(reason.stack);
});
process.on('SIGINT', () => {
envenHandler({
code: 0,
message: 'SIGINT received',
});
});
process.on('SIGTERM', () => {
envenHandler({
code: 0,
message: 'SIGTERM received',
});
});
process.on('SIGINT', () => {
envenHandler({
code: 0,
message: 'SIGINT received',
});
});
const configs = {
env: process.env.NODE_ENV,
PORT: process.env.PORT,
DBURL: process.env.DB_URL,
SECRET_KEY: '00_kepp_secret_atelier_tenis_2022',
appName: 'atelier_tenis',
apiClient: {
userName: 'player01',
},
};
export default configs;