feat: 初始化项目

This commit is contained in:
R524809
2025-11-17 17:53:31 +08:00
commit a9d7fc9038
24 changed files with 7349 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { ConfigService } from '@nestjs/config';
export const getDatabaseConfig = (
configService: ConfigService,
): TypeOrmModuleOptions => ({
type: 'postgres',
host: configService.get('DB_HOST', 'localhost'),
port: configService.get<number>('DB_PORT', 5432),
username: configService.get('DB_USER'),
password: configService.get('DB_PASSWORD'),
database: configService.get('DB_DATABASE'),
synchronize: configService.get('NODE_ENV') !== 'production',
autoLoadEntities: true,
logging: configService.get('NODE_ENV') === 'development',
});