Skip to content

Instantly share code, notes, and snippets.

@Oscar-zw
Last active April 20, 2019 05:14
Show Gist options
  • Save Oscar-zw/083a731729e9ce3df19e5775ec052936 to your computer and use it in GitHub Desktop.
Save Oscar-zw/083a731729e9ce3df19e5775ec052936 to your computer and use it in GitHub Desktop.
app.module para nest dockerizado
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
//Importamos vMongooseModule
import {MongooseModule} from '@nestjs/mongoose'
@Module({
imports: [
//dentro de imports ubicamos la ruta de nuestra db y le ponemos un nombre
//como mongo esta en un contenedor no usamos localhost sino el nombre del contenedor
//recuerden que yo use [mongo_db] si lo cambian en el docker-compose, tambien lo deben
//cambiar aqui
MongooseModule.forRoot('mongodb://mongo_db:27017/my_nest_db')
],
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