import { DynamicModule , Module } from '@nestjs/common' ; import { AppController } from './app.controller' ; import { AppService } from './app.service' ; import { TypeOrmModule } from '@nestjs/typeorm' ; import * as ormconfig from './ormconfig' ; export function DatabaseOrmModule ( ) { return TypeOrmModule . forRoot ( ormconfig ) ; } @ Module ( { imports : [ TypeOrmModule . forRoot ( ormconfig ) ] , controllers : [ AppController ] , providers : [ AppService ] , } ) export class AppModule { }