-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
44 lines (34 loc) · 1.23 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
import * as fs from 'fs';
import SrtLiveServerManager from './src/srtLiveServer/srtLiveServerManager';
import logger from './src/utils/logger';
import config from './config';
function displayLogo() {
if (config.application.hideLogo)
return;
try {
const logo = fs.readFileSync('./logo.txt', 'utf8');
console.log(logo);
console.log();
} catch (error) {
// ignore
}
}
function displayConfig() {
logger.info("Configuration: ");
logger.info(`> Application: `);
logger.info(`> > Log Level: ${config.application.logLevel}`);
logger.info(`> > Hide Logo: ${config.application.hideLogo}`);
logger.info(`> SRT Server: `);
logger.info(`> > Endpoint: ${config.srtLiveServer.endpoint}`);
logger.info(`> > Fetch Interval: ${config.srtLiveServer.fetchInterval}`);
logger.info(`> WebSocket Relay: `);
logger.info(`> > Port: ${config.websocketRelay.port}`);
logger.info(`> > Path: ${config.websocketRelay.path}`);
}
displayLogo();
displayConfig();
const srtLiveServerManager = new SrtLiveServerManager();
process.on('unhandledRejection', (reason, promise) => {
logger.error('Unhandled Rejection at:', promise, 'reason:', reason);
});
srtLiveServerManager.start();