guys. I encountered an error while trying to use the signup form of my site it gives me this error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at in the console of the browser.
I’ve read it’s about the fact that I use my PC as both server for the site itself and database where I want to store the user data, but I don’t know how to fix it. For database I use MongoDB if that’s something that is important. I’m not sure where the problem is so I will post the whole project from github. https://github.com/borki6a/Dreamsurvey
2
Answers
You need something like
in your server.js
This error typically happens when a web app running on one origin requests an API from a server running on another origin.
I think you can configure some http headers to solve the issue:
In your backend API(Suppose using Express.js)