File tree Expand file tree Collapse file tree
src/app/api/stripe/webhook Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ const PORT = process.env.PORT || process.env.WS_PORT || 3001
2929const CLIENT_URL = process . env . NEXT_PUBLIC_APP_URL || "http://localhost:3000"
3030const REDIS_URL = process . env . REDIS_URL || ""
3131
32+ // Build allowed origins list
33+ const allowedOrigins = [
34+ CLIENT_URL ,
35+ "http://localhost:3000" ,
36+ "https://noted-main.vercel.app" ,
37+ ] . filter ( Boolean )
38+
3239// Create HTTP server
3340const httpServer = createServer ( ( req , res ) => {
3441 // Health check endpoint
@@ -48,7 +55,7 @@ const httpServer = createServer((req, res) => {
4855// Create Socket.io server
4956const io = new Server ( httpServer , {
5057 cors : {
51- origin : CLIENT_URL ,
58+ origin : allowedOrigins ,
5259 methods : [ "GET" , "POST" ] ,
5360 credentials : true ,
5461 } ,
Original file line number Diff line number Diff line change @@ -7,13 +7,6 @@ import Stripe from 'stripe'
77export const runtime = 'nodejs'
88export const dynamic = 'force-dynamic'
99
10- // Disable body parsing - we need raw body for webhook verification
11- export const config = {
12- api : {
13- bodyParser : false ,
14- } ,
15- }
16-
1710async function getRawBody ( request : NextRequest ) : Promise < Buffer > {
1811 const chunks : Uint8Array [ ] = [ ]
1912 const reader = request . body ?. getReader ( )
You can’t perform that action at this time.
0 commit comments