Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

nestjs mongoose with config

// app.module.ts
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config'
import { MongooseModule } from '@nestjs/mongoose';

@Module({
  import: [
    MongooseModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: async (config: ConfigService) => ({
       	uri: config.get<string>('MONGODB_URI'), // Loaded from .ENV
      })
    })
  ],
})
export class AppModule {}
Comment

PREVIOUS NEXT
Code Example
Typescript :: how to view documents folder simulator swift 
Typescript :: for of loop in ts with index 
Typescript :: aws sqs create fifo queue 
Typescript :: nest js parseint pipe usage 
Typescript :: Illuminate Contracts Encryption DecryptException The payload is invalid. 
Typescript :: deno router 
Typescript :: typescript html input 
Typescript :: download and run exploits from exploit-db 
Typescript :: style mat-dialog-container 
Typescript :: ionic 4 set root page when logout 
Typescript :: typescript jest types not found 
Typescript :: http requests in spring boot 
Typescript :: why is a tree set sorted 
Typescript :: handling ajax requests in django 
Typescript :: what does lts stand for 
Typescript :: NASDAQ: TSLA 
Typescript :: typescript blob to base64 
Typescript :: ionic email validation 
Typescript :: typscript to string 
Typescript :: get requests method flask 
Typescript :: sort two lists that refence each other 
Typescript :: contents of file to variable python 
Typescript :: how to update typescript in global 
Typescript :: create an array for looping typescript 
Typescript :: append multiple objects to list python 
Typescript :: typescript endless loop 
Typescript :: loc with multiple conditions 
Typescript :: react setstate in hooks to array of objects value 
Typescript :: apexcharts pie chart colors 
Typescript :: react-native-typescript 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =