Skip to content

Commit 6514c99

Browse files
committed
added redis config to deployment
1 parent 8fb7a0e commit 6514c99

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ ORIGIN=http://localhost:5173
22

33
# Database
44
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
5+
REDIS_URL=redis://localhost:6379

render.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ services:
1111
envVars:
1212
- key: DATABASE_URL
1313
fromDatabase:
14-
name: postgres
14+
name: db
15+
property: connectionString
16+
- key: REDIS_URL
17+
fromDatabase:
18+
name: redis
1519
property: connectionString
1620
- key: PUBLIC_ORIGIN
1721
fromDatabase:
@@ -22,6 +26,6 @@ services:
2226
ipAllowList: [] # Only allow internal connections
2327

2428
databases:
25-
- name: postgres
29+
- name: db
2630
databaseName: postgres
2731
ipAllowList: []

src/lib/server/api/middleware/rate-limiter.middlware.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { rateLimiter } from "hono-rate-limiter";
22
import { RedisStore } from 'rate-limit-redis'
33
import RedisClient from 'ioredis'
44
import type { HonoTypes } from "../types";
5+
import { config } from "../common/config";
56

6-
const client = new RedisClient()
7+
const client = new RedisClient(config.REDIS_URL)
78

89
export function limiter({ limit, minutes, key = "" }: {
910
limit: number;

0 commit comments

Comments
 (0)