add users
This commit is contained in:
@@ -1,9 +1,29 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
imports: [
|
||||
TypeOrmModule.forRootAsync({
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
useFactory: (configService: ConfigService) => ({
|
||||
type: 'postgres',
|
||||
host: configService.get<string>('POSTGRES_HOST'),
|
||||
port: parseInt(configService.get<string>('POSTGRES_PORT', '5432'), 10),
|
||||
username: configService.get<string>('POSTGRES_USER'),
|
||||
password: configService.get<string>('POSTGRES_PASSWORD'),
|
||||
database: configService.get<string>('POSTGRES_DB'),
|
||||
ssl: {
|
||||
rejectUnauthorized: false, // Needed for Neon and similar managed DBs
|
||||
},
|
||||
synchronize: true, // Disable in production
|
||||
}),
|
||||
}),
|
||||
ConfigModule.forRoot(),
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user