import * as env from 'dotenv' ; import { PublicConfigModel } from '../model/public-config-model' ; since date author Luminous(BGLuminous)
  export class EnvLoaderUtil { private static INSTANCE : EnvLoaderUtil ; private readonly config : PublicConfigModel ; private private constructor ( ) { env . config ( ) ; this . config = { amqpServerUrl : process . env . AMQP_SERVER_URL , managerApiUrl : process . env . MANAGER_API_URL , managerAuth : process . env . MANAGER_AUTH , maxChannelCount : Number ( process . env . MAX_CHANNEL_COUNT ) , autoReconnect : process . env . AUTO_RECONNECT ? process . env . AUTO_RECONNECT as unknown as boolean : true } ; } return { EnvLoaderUtil } constructor public static getInstance ( ) { if ( ! this . INSTANCE ) { this . INSTANCE = new EnvLoaderUtil ( ) ; } return this . INSTANCE ; } return { PublicConfigModel } public getPublicConfig ( ) { return this . config ; } }