Spyna / push-notification-demo

How to implement Web Push Notifications with live demo and instructions
https://push-notifications-demo.netlify.app/
MIT License
214 stars 93 forks source link

corsErrorSetup #2

Closed louatiSaadeddine closed 2 years ago

louatiSaadeddine commented 4 years ago

Cross-Origin Request Blocked with React and Express, so you have to use CORS module with right way

Spyna commented 4 years ago

The server that is online at https://push-notification-demo-server.herokuapp.com accepts CORS request only from these origins:

If you need to run the react front-end from another origin, consider deploying your own server with the env variable CORS_ORIGIN. The value of this variable has to be a comma-separated list of origins you accept.