From 8247fffe364be454a58cb2b7d8e9ec99053e1b97 Mon Sep 17 00:00:00 2001 From: selvi Date: Mon, 22 Jun 2026 19:58:19 +0530 Subject: [PATCH] cors fixes --- server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 6fee522..ad3f866 100644 --- a/server.js +++ b/server.js @@ -7,7 +7,11 @@ const { generateShippingLabelPDF } = require('./shippingLabelGenerator'); const { sendEmailWithAttachment } = require('./mailer'); const app = express(); -app.use(cors()); // Allow frontend Shopify store to call this server +app.use(cors({ + origin: '*', // Allow all origins (you can restrict this to 'https://rayaarishop.com' in production) + methods: ['GET', 'POST', 'OPTIONS', 'PUT', 'PATCH', 'DELETE'], + allowedHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization', 'X-Shopify-Hmac-Sha256', 'X-Shopify-Access-Token'] +})); // Allow frontend Shopify store to call this server const PORT = process.env.PORT || 3000; // Middleware to capture raw body for Shopify webhook HMAC verification