Hi, folks. I’m working on my developer portfolio, hosting it on Netlify, which is front-end only. I want to have a contact form that sends me an email, so I set up an API endpoint with Node, hosted on Heroku, to accomplish this. Unfortunately, when I try to send a post request to the API, I get an error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://myapiendpoint.herokuapp.com. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
I’m finding lots of information on why this is happening, but I can’t seem to find anything on how to actually go about configuring my server to allow requests from my portfolio site. If anyone can explain how to do this, it’d be much appreciated.