All files / environment api-environment.ts

100% Statements 8/8
100% Branches 0/0
100% Functions 2/2
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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                                        4x   4x   4x   4x     4x             1x   1x   1x    
import type { Provider } from '@nestjs/common';
 
import { initializeClassProperties } from '../utils/class.util';
 
export interface IApiEnvironment {
  production: boolean;
  firebase: boolean;
  appName: string;
  grpcUrl: string;
}
 
/**
 * Application name type.
 */
export type TApiAppName = 'Nx Ng Starter API' | string;
 
/**
 * API application environment.
 */
export class AppApiEnvironment implements IApiEnvironment {
  public production = false;
 
  public firebase = false;
 
  public appName: TApiAppName = 'Nx Ng Starter API';
 
  public grpcUrl = '0.0.0.0:50051';
 
  constructor(input?: Partial<AppApiEnvironment>) {
    initializeClassProperties<Partial<AppApiEnvironment>>(this, input);
  }
}
 
/**
 * Api environment injection token.
 */
export const API_ENV = 'API_ENV';
 
export const apiAppEnvProvider: Provider = {
  provide: API_ENV,
  useFactory: () => new AppApiEnvironment(),
};