Fetch API giving 404 not found error In Netlify

Viewed 278

Hi this is my test site on which I am working.

https://keen-archimedes-cc5aba.netlify.app/

I am using fetch for post api

fetch('/.netlify/functions/get-protected-content', {
        method: 'POST',
         body: JSON.stringify({ type }),
       })

It's giving 404 error.

enter image description here

This is my folder directory

enter image description here

my Publish directory is "_book" I am calling above api from index.html inside "_book" folder.

It's give not found error.

When I am moving "functions" folder inside "_book" it's also not working.

What could be the issue ?

0 Answers
Related