增加数据库配置
This commit is contained in:
parent
efc2091869
commit
833274304f
|
@ -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],
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue