You can solve the Cross Origin issue by proxying from your origin (the web server) to the API server.
Change the calls in the client code to send requests to /api/whatever
(deliberate lack of scheme, host and port there, so it uses the one that served the page). From the client's perspective this is no longer a request to a different host.
I guess that in the action you dispatch, this would correspond to changing the endpoint
property:
endpoint: `/api/top-headlines?country=us&category=business&apiKey=${API_KEY}`
Then set up a path-based proxy in your web server to match routes starting with /api
and proxy them to https://newsapi.org/v2
. For example, using http-proxy-middleware:
var proxy = require('http-proxy-middleware');
app.use('/api', proxy({target: 'https://newsapi.org/v2'}));
Note that the "Access-Control-Allow-Origin" header is set by the server, not the client, so it's not doing anything useful in your example.