-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathapp.ts
executable file
·32 lines (26 loc) · 920 Bytes
/
app.ts
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
/* eslint-disable import/first */
/* eslint-disable no-unused-expressions */
/* eslint-disable global-require */
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable jest/require-hook */
// tslint:disable-next-line:no-unused-expression
process.env.ENV_FILE !== null && require('dotenv').config({ path: process.env.ENV_FILE });
import { logger } from '@cdm-logger/server';
import './server';
process.on('uncaughtException', (ex) => {
logger.error(ex);
process.exit(1);
});
process.on('unhandledRejection', (reason) => {
logger.error(reason);
});
if ((module as any).hot) {
(module as any).hot.status((event) => {
if (event === 'abort' || event === 'fail') {
logger.error(`HMR error status: ${event}`);
// Signal webpack.run.js to do full-reload of the back-end
process.exit(250);
}
});
(module as any).hot.accept();
}