router.get("/", (req, res) => {
res.setHeader("Access-Control-Allow-Origin", "http://localhost:3000");
User.find()
.sort({ name: -1 })
.then(theUsers => {
res.json(theUsers);
});
});
I have put the header. It also shows in postman. Why does it keep blocking me?
I have also put * on the value but still does not work.