Skip to content

Instantly share code, notes, and snippets.

@NooNoo1337
Created November 9, 2021 16:10
Show Gist options
  • Save NooNoo1337/008d0d0d8a6c5220a088156e43881a1c to your computer and use it in GitHub Desktop.
Save NooNoo1337/008d0d0d8a6c5220a088156e43881a1c to your computer and use it in GitHub Desktop.
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { getPostgresConfig } from '@configs/postgres.config';
import { GraphQLModule } from '@nestjs/graphql';
import { TravelModule } from '@modules/travel/travel.module';
import { getGraphQLConfig } from '@configs/graphql.config';
@Module({
imports: [
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: getPostgresConfig,
}),
GraphQLModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: getGraphQLConfig,
}),
TravelModule,
],
})
export class AppModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment