I\'m using Reactjs and using API through AJAX in javascript. How can we resolve this issue? Previously I used CORS tools, but now I need to enable CORS.
Use this.
app.use((req,res, next)=>{ res.setHeader('Access-Control-Allow-Origin',"http://localhost:3000"); res.setHeader('Access-Control-Allow-Headers',"*"); res.header('Access-Control-Allow-Credentials', true); next(); });