Hi. I’m trying to hide my API key using netlify functions. I have defined function called youtube.js that is supposed to fetch data from the youtube API using Id. It’s not working neither after deployment nor at localhost (returning 404). Here is my netlify site: https://eloquent-brattain-7a2cec.netlify.app/
When I try to make fetch request for example for this address https://eloquent-brattain-7a2cec.netlify.app/.netlify/functions/youtube?id=d1UD5UYUQ6c I get this in the browser:
TypeError: Converting circular structure to JSON
→ starting at object with constructor ‘ClientRequest’
| property ‘socket’ → object with constructor ‘TLSSocket’
— property ‘_httpMessage’ closes the circle
Fetching data without using netlify functions works fine
Can you help me with this issue?