Skip to content

Commit

Permalink
fix(redis): connect redis client in production and preview
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Nov 13, 2023
1 parent 9f4514c commit 9819f91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/services/redis.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Redis from 'ioredis';

const client = new Redis();
const client = new Redis({
host: process.env.REDIS_HOST,
password: process.env.REDIS_PASSWORD,
port: process.env.REDIS_PORT
});

export default client;

8 changes: 5 additions & 3 deletions src/types/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
namespace NodeJS {
interface ProcessEnv {
readonly VERCEL_ENV: 'preview' | 'development' | 'production';
readonly NEXT_PUBLIC_VERCEL_URL: string;

readonly NEXT_PUBLIC_JWT_SECRET: string;

readonly NEXTAUTH_SECRET: string;
readonly FLASK_SECRET: string;
readonly CRON_SECRET: string;
readonly SVG_FETCH_SECRET: string;

readonly REDIS_HOST?: string;
readonly REDIS_PASSWORD?: string;
readonly REDIS_PORT?: number;

readonly GITHUB_ID: string;
readonly GITHUB_SECRET: string;
Expand Down

0 comments on commit 9819f91

Please sign in to comment.