We're building a SPA using vue.js and Node.js (Express). The SPA is downloaded from 1 domain and the REST api is in another one.
The issue is that I've noticed that Chrome does 2 request instead of 1 when doing an ajax call to another domain different from the one where the web page was downloaded (CORS request).
After doing some research, I've come to the conclusion that it's a feature, not a bug.
So, what should be the best approach to solve this in an elegant way?
I currently discard the first request with a 200 status response, but I don't think it's the best way to do this.