Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
We have a typical issue, the node api with the below cors configuration works with angular 7.x apps
app.use(cors(corsOptions));
app.get('/myapi/', myfunction);


But with angular 9.x it throws the cors issue which gets rectified when we add the below
app.options('*', cors());
app.get('/myapi/', cors(corsOptions), myfunction);



Any suggestion on this would be really helpful.

Thanks

sandip

What I have tried:

<pre>
 app.options('*', cors());
 app.get('/myapi/', cors(corsOptions), myfunction);
Posted
Comments
Richard MacCutchan 10-Jul-20 3:42am    
What does the documentation say?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900