From 387b402177131cb0b4d76dac7d723108d360ed36 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 4 Apr 2024 11:04:12 +0530 Subject: [PATCH] Added frontend in whiteList and also cors() --- configs/Corsoptions.js | 1 + server.js | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/Corsoptions.js b/configs/Corsoptions.js index 5657b66..186d5d8 100644 --- a/configs/Corsoptions.js +++ b/configs/Corsoptions.js @@ -3,6 +3,7 @@ const whiteList = [ 'https://www.yourSite.com', 'http://127.0.0.1:5500', 'https://expense-api.onrender.com', + 'https://expense-frontend-5dj3.onrender.com' ] const corsOptions = { origin:(origin,callback)=>{ diff --git a/server.js b/server.js index f4d9020..2cbedbf 100644 --- a/server.js +++ b/server.js @@ -20,6 +20,7 @@ app.use(helemt.crossOriginResourcePolicy({policy:'cross-origin'})); app.use(morgan('common')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended:true})); +app.use(cors()); app.use(cors(corsOptions));