Allow Access-Control-Allow-Origin header using HTML5 fetch API
Like epascarello said, the server that hosts the resource needs to have CORS enabled. What you can do on the client side (and probably what you are thinking of) is set the mode of fetch to CORS (although this is the default setting I believe): fetch(request, {mode: ‘cors’}); However this still requires the server to … Read more