Cross domain from browser to express server doesn't work

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Cross domain from browser to express server doesn't work



I know this has been asked more than a hundred times... I did look into most of the information I found, and think I did understand the process, cause I was able to configure my s3 to allow cross domain access..



my express configuration:


this.express = new Express();
this.express.all("*", (req, res, next) => {

res.setHeader('Access-Control-Allow-Origin', "*");
res.setHeader('Access-Control-Allow-Methods', "POST");
res.setHeader('Access-Control-Allow-Headers', "content-type");
next();
}).options((req, res, next) => {
res.end();
});



*I add a router down the modules folder hierarchy..



When I check the network tab this is what I see:



enter image description here



I think that I have answered the CORS challenge, in the pre-flight OPTIONS request, but the second request is not called...



WHY?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Visual Studio Code: How to configure includePath for better IntelliSense results

Spring cloud config client Could not locate PropertySource

Regex - How to capture all iterations of a repeating pattern?