license import process from 'process' ; import prodConfig from './config.prod' ; import devConfig from './config.dev' ; import { Config } from './config' ; import { Server } from './server' ; const env = process . env . NODE_ENV ; let config ; if ( env === 'production' ) { config = prodConfig ; } else { config = devConfig ; } const server = new Server ( config ) ; async function init ( ) { await configure ( ) ; server . start ( ) ; } init ( ) ; async function configure ( ) { try { await server . configure ( ) ; } catch ( ex ) { console . error ( ex ) ; process . exit ( 1 ) ; } }