-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
34 lines (29 loc) · 1.05 KB
/
index.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
process.env.NTBA_FIX_319 = 1;
/****************************************************************
* IMPORTS
****************************************************************/
const DOTENV = require('dotenv')
DOTENV.config();
const { OPTIONS } = require('./src/setup/config.js');
const { Secrets } = require('./src/models/secrets');
const { MyApp } = require('./src/app.js');
/****************************************************************
* METHODS
****************************************************************/
async function main () {
// add in delay to prevent overload upon restart:
console.log(`Service started...`);
await (new Promise(_ => setTimeout(_, 1000)))
console.log(`Setup app...`);
let secret = new Secrets();
const app = new MyApp(OPTIONS, secret);
app.setup();
app.start();
console.log(`Listening to user input...`);
}
/****************************************************************
* EXECUTION
****************************************************************/
if (require.main === module) {
main();
}