XMLHttpRequest cannot load. No 'Access-Control-Allow-Origin' header is present on the requested resource. Console error in Node JS
Guest Post :Console error in Node JS
As nodejs Server is running on 3000 port, how to send data to angular app which is running in 9000 port. Server and client are both in my local machine.
XMLHttpRequest cannot load. No 'Access-Control-Allow-Origin' header is present on the requested resource.
Solution :
Add Cors to express server because your trying to access the server on a different port than the client it will through a cors error. Install cors and then app.use(cors())
npm install cors -- save
Add this to server.js
const cors = require ('cors');
app.use(cors);
Users Please post your solution.