We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b452085 commit 2fb4a3bCopy full SHA for 2fb4a3b
libs/data-api/src/lib/data-api.module.ts
@@ -9,10 +9,13 @@ import { RedisModule } from "@nestjs-modules/ioredis";
9
RedisModule.forRootAsync({
10
imports: [ConfigModule.forRoot({ isGlobal: true })],
11
inject: [ConfigService],
12
- useFactory: (configService: ConfigService) => ({
13
- type: "single",
14
- url: `redis://${configService.get("REDIS_HOST")}:${configService.get("REDIS_PORT")}`
15
- })
+ useFactory: (configService: ConfigService) => {
+ const protocol = process.env["NODE_ENV"] === "development" ? "redis://" : "rediss://";
+ return {
+ type: "single",
16
+ url: `${protocol}${configService.get("REDIS_HOST")}:${configService.get("REDIS_PORT")}`
17
+ };
18
+ }
19
})
20
],
21
providers: [DataApiService],
0 commit comments