Skip to content

Commit

Permalink
Merge branch 'dev' into feat/stripe-payment
Browse files Browse the repository at this point in the history
  • Loading branch information
agrattan0820 committed Oct 4, 2023
2 parents a980ae7 + a33c280 commit f8c01fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
2 changes: 1 addition & 1 deletion apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@sentry/nextjs": "^7.72.0",
"@tanstack/react-query": "^4.35.3",
"@upstash/ratelimit": "^0.4.4",
"@upstash/redis": "^1.22.1",
"@vercel/analytics": "^1.0.2",
"@vercel/kv": "^0.2.3",
"@xstate/react": "^3.2.2",
"autoprefixer": "10.4.16",
"clsx": "^2.0.0",
Expand Down
6 changes: 4 additions & 2 deletions apps/client/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { NextRequest, NextResponse } from "next/server";
import { Ratelimit } from "@upstash/ratelimit";
import { kv } from "@vercel/kv";
import { Redis } from "@upstash/redis";

const ratelimit = new Ratelimit({
redis: kv,
redis: Redis.fromEnv(),
// 5 requests from the same IP in 10 seconds
limiter: Ratelimit.slidingWindow(5, "10 s"),
analytics: true,
prefix: "@upstash/ratelimit",
});

export const config = {
Expand Down
23 changes: 3 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f8c01fe

Please sign in to comment.