That’s to do with the backend. Your server isn’t set up to receive requests from the URL you’re using (localhost). If you’re the one writting the server, look up the cors npm package to enable cross site requests. Otherwise, ask whoever is the author of the server.
you are not useing cors or same url for frondend and backend thats why this error coming .For send data frontend to sarver you need use "cors" package.
install cors:
2
Answers
That’s to do with the backend. Your server isn’t set up to receive requests from the URL you’re using (localhost). If you’re the one writting the server, look up the cors npm package to enable cross site requests. Otherwise, ask whoever is the author of the server.
you are not useing cors or same url for frondend and backend thats why this error coming .For send data frontend to sarver you need use "cors" package.
install cors:
then requre it index.js file