diff --git a/next.config.js b/next.config.js index 40dec91..6035b48 100644 --- a/next.config.js +++ b/next.config.js @@ -24,6 +24,27 @@ module.exports = removeImports({ } ]; }, + async headers() { + return [ + { + source: "/api/:path*", + headers: [ + { + key: "Access-Control-Allow-Origin", + value: "https://plebdevs-three.vercel.app", // Set your origin + }, + { + key: "Access-Control-Allow-Methods", + value: "GET, POST, PUT, DELETE, OPTIONS", + }, + { + key: "Access-Control-Allow-Headers", + value: "Content-Type, Authorization", + }, + ], + }, + ]; + }, env: { KV_URL: process.env.NODE_ENV !== 'production' ? process.env.REDIS_URL diff --git a/src/middleware.js b/src/middleware.js index 8980831..cf29440 100644 --- a/src/middleware.js +++ b/src/middleware.js @@ -53,8 +53,6 @@ export default async function middleware(request) { `ratelimit_middleware_${ip}` ); - console.log("headers", request.headers) - if (!success) { return new NextResponse('Too Many Requests', { status: 429,