cannot use wildcard in access-control-allow-origin when credentials flag is true
var corsOptions = {
origin: 'http://localhost:3000',
credentials : true
}
app.use(cors(corsOptions));
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3000');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
res.setHeader('Access-Control-Allow-Credentials', true);
next();
});
Also in JavaScript:
- how to add functionality inside js object
- What is the correct JavaScript syntax for opening a new window called "w2" ?
- useeffect cleanup function
- javascript get multiple elements by id
- appendchild element once if element present in js
- check browser locale javascript
- javascript switch assignment
- cJSON_CreateObject
- ajax.complete(handler) example jquery
- samesite cookie nodejs
- fetch download blob file
- javascript float to int
- how to count occurences in an array with javascript
- jquery replace text
- nodejs format text
- javascript increment
- get latest file from s3 bucket javascript
- Sum of all the multiples of 3 or 5
- how to export module in node js
- jquery do something if toggle open and close
- docker node placement constraints
- p5 js functions
- javascript moment get current date
- jquery each has class