Skip to content

Commit

Permalink
Improve RDS config for connection
Browse files Browse the repository at this point in the history
  • Loading branch information
paweld-iRonin committed Oct 22, 2023
1 parent c940f7b commit 87a335b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"deploy": "npm run build && npm run typeorm:run-migrations && node dist/main",
"deploy": "npm run build && npm run typeorm:run-migrations && node dist/src/main",
"typeorm": "ts-node ./node_modules/typeorm/cli",
"typeorm:create-migration": "npm run typeorm -- migration:create",
"typeorm:run-migrations": "npm run typeorm migration:run -- -d ./typeOrm.config.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/database/database.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { TypeOrmModule } from '@nestjs/typeorm';
database: configService.getOrThrow('DATABASE_NAME'),
username: configService.getOrThrow('DATABASE_USER'),
password: configService.getOrThrow('DATABASE_PASSWORD'),
autoLoadEntities: true,
ssl: configService.getOrThrow('NODE_ENV') === 'production',
ssl: configService.getOrThrow('NODE_ENV') === 'production' ? { rejectUnauthorized: false } : false,
autoLoadEntities: true
}),
inject: [ConfigService],
}),
Expand Down
2 changes: 1 addition & 1 deletion typeOrm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default new DataSource({
database: configService.getOrThrow('DATABASE_NAME'),
username: configService.getOrThrow('DATABASE_USER'),
password: configService.getOrThrow('DATABASE_PASSWORD'),
ssl: configService.getOrThrow('NODE_ENV') === 'production',
ssl: configService.getOrThrow('NODE_ENV') === 'production' ? { rejectUnauthorized: false } : false,
migrations: ['migrations/**'],
entities: [Company],
});

0 comments on commit 87a335b

Please sign in to comment.