Skip to content

Instantly share code, notes, and snippets.

Avatar

Ambroise Rabier ambroiseRabier

View GitHub Profile
@joseluisq
joseluisq / database.module.ts
Last active Aug 29, 2020
Nest Database Module (Type ORM) with environment variables support
View database.module.ts
import { Module, Global, DynamicModule } from '@nestjs/common'
import { EnvModule } from './env.module'
import { EnvService } from './env.service'
import { TypeOrmModule } from '@nestjs/typeorm'
function DatabaseOrmModule (): DynamicModule {
const config = new EnvService().read()
return TypeOrmModule.forRoot({
type: config.DB_TYPE,
You can’t perform that action at this time.