Last active
April 20, 2019 05:14
-
-
Save Oscar-zw/083a731729e9ce3df19e5775ec052936 to your computer and use it in GitHub Desktop.
app.module para nest dockerizado
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 { 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