Skip to content

Commit

Permalink
feat: keydb周りを整備 #240
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Aug 29, 2024
1 parent df18464 commit 5b48cb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/lib/env.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export const env = createEnv({
.default('akarinext-web-pg-rw.akarinext-web'),
POSTGRES_PORT: z.optional(z.string()).default('5432'),

KEYDB_HOST: z.string(),
KEYDB_PORT: z.string(),
KEYDB_PASSWORD: z.string(),

S3_BUCKET_NAME: z.string(),
S3_ACCESS_KEY: z.string(),
S3_SECRET_KEY: z.string(),
Expand Down
7 changes: 7 additions & 0 deletions app/lib/keydb.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Redis } from 'ioredis';
import { singleton } from './singleton.server';
import { env } from './env.server';

export const keyDb = singleton('keyDb', () => new Redis(
{host: env.KEYDB_HOST, port: parseInt(env.KEYDB_PORT), password: env.KEYDB_PASSWORD}
));

0 comments on commit 5b48cb2

Please sign in to comment.