From 833274304f84c1755a336ee812270c6b146f4b0e Mon Sep 17 00:00:00 2001 From: Jeremy Yin Date: Wed, 26 Jun 2019 21:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.module.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app.module.ts b/src/app.module.ts index 8662803..75987c4 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,9 +1,21 @@ import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; +import { TypeOrmModule } from '@nestjs/typeorm'; @Module({ - imports: [], + imports: [ + TypeOrmModule.forRoot({ + type: 'mysql', + host: 'localhost', + port: 3306, + username: 'root', + password: 'jeremy', + database: 'nest', + synchronize: true, + entities: [__dirname + '/**/*.entity{.ts,.js}'], + }), + ], controllers: [AppController], providers: [AppService], })