Last active
June 19, 2019 03:49
-
-
Save chnirt/5c93e914d51b3ced5d2d672a80de259b to your computer and use it in GitHub Desktop.
NestJs
This file contains hidden or 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 { AppController } from './app.controller'; | |
import { AppService } from './app.service'; | |
import { GraphQLModule } from '@nestjs/graphql'; | |
import { UserModule } from './user/user.module'; | |
import { TypeOrmModule } from '@nestjs/typeorm'; | |
import { join } from 'path'; | |
@Module({ | |
imports: [ | |
GraphQLModule.forRoot({ | |
typePaths: ['./**/*.graphql'], | |
playground: true, | |
}), | |
TypeOrmModule.forRoot({ | |
type: 'mongodb', | |
url: | |
'mongodb+srv://<admin>:<password>@chnirt-graphql-apollo-vg0hq.mongodb.net/nest?retryWrites=true&w=majority', | |
entities: [join(__dirname, '**/**.entity{.ts,.js}')], | |
synchronize: true, | |
useNewUrlParser: true, | |
logging: true, | |
}), | |
UserModule, | |
], | |
controllers: [AppController], | |
providers: [AppService], | |
}) | |
export class AppModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment