1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; import { UserModule } from './user/user.module'; import { TypeOrmModule } from '@nestjs/typeorm';
@Module({ imports: [ UserModule, TypeOrmModule.forRoot({ type: 'mysql', host: 'localhost', port: 3306, username: 'root', password: 'root', database: 'typeorm_mysql', synchronize: true, logging: true, entities: ['./**/entities/*.ts'], poolSize: 10, migrations: [], subscribers: [], connectorPackage: 'mysql2', extra: { authPlugin: 'sha256_password', }, }), ], controllers: [AppController], providers: [AppService], }) export class AppModule {}
|