Skip to content

Instantly share code, notes, and snippets.

@adsonrocha
Created October 22, 2019 23:37
Show Gist options
  • Save adsonrocha/0e46e0a920c649c7dba1c664e714949a to your computer and use it in GitHub Desktop.
Save adsonrocha/0e46e0a920c649c7dba1c664e714949a to your computer and use it in GitHub Desktop.
User Module importing Mongoose
import { Module } from '@nestjs/common';
import { UserService } from './user.service';
import { UserController } from './user.controller';
import { MongooseModule } from '@nestjs/mongoose';
import { UserSchema } from './user.model';
@Module({
imports: [
MongooseModule.forFeature([{
name: 'User', schema: UserSchema,
}]),
],
providers: [UserService],
controllers: [UserController],
})
export class UserModule {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment