Skip to content

Commit 3e4df9b

Browse files
Subham12Rclaude
andcommitted
Add multiple CORS origins for Vercel deployment
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 493e415 commit 3e4df9b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

server/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ const PORT = process.env.PORT || process.env.WS_PORT || 3001
2929
const CLIENT_URL = process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"
3030
const 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
3340
const httpServer = createServer((req, res) => {
3441
// Health check endpoint
@@ -48,7 +55,7 @@ const httpServer = createServer((req, res) => {
4855
// Create Socket.io server
4956
const io = new Server(httpServer, {
5057
cors: {
51-
origin: CLIENT_URL,
58+
origin: allowedOrigins,
5259
methods: ["GET", "POST"],
5360
credentials: true,
5461
},

src/app/api/stripe/webhook/route.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ import Stripe from 'stripe'
77
export const runtime = 'nodejs'
88
export 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-
1710
async function getRawBody(request: NextRequest): Promise<Buffer> {
1811
const chunks: Uint8Array[] = []
1912
const reader = request.body?.getReader()

0 commit comments

Comments
 (0)