import * as path from 'path' ; import 'reflect-metadata' ; import { install } from 'source-map-support' ; import ILoggerModel from '../ILoggerModel' ; import container from '../ModelContainer' ; import * as containerSetter from '../ModelContainerSetter' ; import IEncodeFinishModel from './encode/IEncodeFinishModel' ; import IServiceServer from './IServiceServer' ; install ( ) ; containerSetter . set ( container ) ; const loggerModel = container . get < ILoggerModel > ( 'ILoggerModel' ) ; loggerModel . initialize ( path . join ( __dirname , '..' , '..' , '..' , 'config' , 'serviceLogConfig.yml' ) ) ; const log = loggerModel . getLogger ( ) ; process . on ( 'uncaughtException' , err => { log . system . fatal ( `uncaughtException: ${ err }` ) ; } ) ; process . on ( 'unhandledRejection' , err => { log . system . fatal ( `unhandledRejection: ${ err }` ) ; } ) ; const encodeFinishModel = container . get < IEncodeFinishModel > ( 'IEncodeFinishModel' ) ; encodeFinishModel . set ( ) ; const serviceServer = container . get < IServiceServer > ( 'IServiceServer' ) ; try { serviceServer . start ( ) ; } catch ( err ) { log . system . fatal ( err ) ; process . exit ( 1 ) ; }