From e22a9ceb9320a6a1b9b3930db6eeb3f5c58da246 Mon Sep 17 00:00:00 2001 From: Shivam Date: Fri, 9 Feb 2024 23:36:31 +0530 Subject: [PATCH] api_url_change-1 --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 55a0cb7..45e61d6 100644 --- a/index.js +++ b/index.js @@ -17,8 +17,13 @@ const cors = require("cors") app.set('trust proxy', 1); app.use(cors({ origin:'https://home-kart.vercel.app', - credentials:true + credentials:true, + })) +app.use((req, res, next) => { + res.header('Access-Control-Allow-Origin', '*'); + next(); + }); app.use(express.json())