NestJS
├─src
│ ├─users
│ │ ├─users.module.ts
│ │ └─users.resolver.ts
│ ├─app.module.ts
│ └─main.ts
├─test
│ └─...test files
└─eslint,env,prettier etc config files
Last active
February 16, 2021 09:21
-
-
Save DillonMemo/b3baaa55131d445be60ef39651248661 to your computer and use it in GitHub Desktop.
NestJS Configure Practice with TypeORM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module } from '@nestjs/common'; | |
import { GraphQLModule } from '@nestjs/graphql'; | |
import { TypeOrmModule } from '@nestjs/typeorm'; | |
import { UsersModule } from './users/users.module'; | |
@Module({ | |
imports: [ | |
GraphQLModule.forRoot({ | |
autoSchemaFile: true, // == autoSchemaFile: join(process.cwd(), 'src/schema.gql'), | |
}), | |
TypeOrmModule.forRoot({ | |
type: 'postgres', | |
host: 'localhost', | |
port: 5432, | |
username: 'dillon', | |
password: '', | |
database: 'testDB', | |
synchronize: true, | |
logging: true, | |
}), | |
UsersModule, | |
], | |
controllers: [], | |
providers: [], | |
}) | |
export class AppModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment