summaryrefslogtreecommitdiff
path: root/src/app.module.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.module.ts')
-rw-r--r--src/app.module.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/app.module.ts b/src/app.module.ts
index 8662803..dca7dcc 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(process.env.NODE_ENV === 'development' ? {
+ type: 'postgres',
+ host: 'localhost',
+ port: 5432,
+ database: process.env.DATABASE_URL,
+ autoLoadEntities: true,
+ } : {
+ url: process.env.DATABASE_URL,
+ ssl: { rejectUnauthorized: true }
+ })
+ ],
controllers: [AppController],
providers: [AppService],
})