Skip to content

Commit

Permalink
Added frontend in whiteList and also cors()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev committed Apr 4, 2024
1 parent 2a5cd10 commit 387b402
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions configs/Corsoptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)=>{
Expand Down
1 change: 1 addition & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));


Expand Down

0 comments on commit 387b402

Please sign in to comment.