import { Global, Module } from '@nestjs/common';
import { getConfig } from '@hexahost/config';

import { APP_CONFIG } from './config.constants';

@Global()
@Module({
  providers: [
    {
      provide: APP_CONFIG,
      useFactory: () => getConfig(),
    },
  ],
  exports: [APP_CONFIG],
})
export class AppConfigModule {}
