Hi!
I have backend (Node + Express) deployed on Netlify which I use to process my requests from frontend deployed at gh-pages. I use json file as storage for my data. Right now I can only successfully complete my GET request. My POST request fails due to CORS policy. I’ve added cors headers to netlify.toml, specified origin in my cors middleware to no avail. I’m literally out of ideas why it is not working. When using postman to test, I receive the correct 201 code but the data is never written to the json file. Maybe you will be able to help me fix the POST request.
My repo for backend and frontend.
Hi what is your site name?
Hi! My site name is: https://comments-spa.netlify.app
Headers for Functions cannot be set through netlify.toml
as mentioned in the first point of the limitations:
You need to send the headers from the function itself.