The function is working fine on my localhost and also when I called it by using insomnia. But when I call it from my website it returns nothing. Not even an error, it seems it has never been called at all.
The website was imported on netlify using github and the function was added later using the command netlify functions:create
I believe there is something wrong with the build because when I publish the website autimatically by commiting changes on github the functions disappear and the endpoint returns 404 at insomia. But if I use netlify deploy --prod all the console.log that I added on my page page stops working and the function works at insomnia.
Someone can please help me figure out what is happening?
Thanks in advance
Thanks for reaching out! Have you created a netlify/functions path at the root of the project for automatic detection. Alternatively, you could use another path (e.g. functions ), adding the directory configuration similarly to this user in this post.
I changed the title because I was making a silly mistake. Was ignoring netlify/functions folder on github thats way it was overriding when publishing by github.
I still don’t know why doesn’t work when I call the function through the webpage