Skip to content

Commit

Permalink
Debugging Upstash #14
Browse files Browse the repository at this point in the history
  • Loading branch information
david emioma committed Apr 3, 2024
1 parent 6be5302 commit c73436f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
env:
VERCEL_ENV: preview
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}

test:
needs: preview-deployment
Expand Down
14 changes: 2 additions & 12 deletions lib/redis.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import { Redis } from "@upstash/redis";
import { Ratelimit } from "@upstash/ratelimit";

const url = process.env.UPSTASH_REDIS_REST_URL as string;

const token = process.env.UPSTASH_REDIS_REST_TOKEN as string;

if (!url || !token) {
throw new Error(
"Redis URL or Token is not defined in environment variables."
);
}

export const redis = new Redis({
url,
token,
url: "https://firm-macaw-48172.upstash.io",
token: process.env.UPSTASH_REDIS_REST_TOKEN ?? "",
});

export const apiRatelimit = new Ratelimit({
Expand Down

0 comments on commit c73436f

Please sign in to comment.