Server-side (index.js) cannot receive get request (fetch(genres/) from client-side

Hi,

website: https://pickyourmovie.netlify.app

In this project, my client-side (scripts.js) try to issue get request to the server-side (index.js) with “fetch(genres/)”. However, “app.get(‘/genres’, async (req, res)=>{}” in index.js seems to not receive that request. Thus, the website has error “Failed to load resource: the server responded with a status of 404 () for https://pickyourmovie.netlify.app/genres/”.

Would you be able to help me resolve this problem? Is there anyway for me to do so “https://pickyourmovie.netlify.app/genres/” can forward to “app.get(‘/genres’, async (req, res)=>{}” in index.js? The project works fine locally.

Thank you.

Netlify doesn’t run Express app. You need to use Netlify Functions. See examples: