add db
This commit is contained in:
+3
-1
@@ -1,10 +1,12 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { database } from './config';
|
||||
|
||||
import { ContentModule } from './modules/content/content.module';
|
||||
import { CoreModule } from './modules/core/core.module';
|
||||
import { DatabaseModule } from './modules/database/database.module';
|
||||
|
||||
@Module({
|
||||
imports: [ContentModule, CoreModule.forRoot(), DatabaseModule],
|
||||
imports: [ContentModule, CoreModule.forRoot(), DatabaseModule.forRoot(database)],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
|
||||
|
||||
export const database = (): TypeOrmModuleOptions => ({
|
||||
charset: 'utf8mb4',
|
||||
logging: ['error'],
|
||||
type: 'mysql',
|
||||
host: '192.168.50.26',
|
||||
port: 3306,
|
||||
username: '3r',
|
||||
password: '12345678',
|
||||
database: '3r',
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export * from './database.config';
|
||||
Reference in New Issue
Block a user