Closed zczcs12 closed 2 years ago
Hi Ben,
Sorry it's taken a while to get back to this issue.
The reason the JS app can't communicate directly with the Google News servers is due to CORS.
The workaround is to run your own proxy server. I've included a very simple proxy in server.js
in the root of the project.
To use use it, in a second terminal window simply run:
node ./server.js
Then you'll have the debug server and the proxy server both running and they should be able to communicate with each other and relay news data from the Google News servers.
With the latest version of react-scripts
a simpler proxy setup is possible.
Just run npm start
to proxy Google News by default
REACT_APP_API_ROOT
to RSS feed API server or your own proxy to Google News.npm run build
Hi, please forgive me if this is a novice question, but that is exactly what I am when it comes to javascript.
When I run the project (npm start) on my local machine, I get a stack of errors like the following:
It appears my requests are not being sent to news.google.com but to localhost. Can you tell me what I need to change please?