DEV Community

Discussion on: When Netlify gives you that 404 page

Collapse
 
swsalim profile image
Yuyu

Does it work with ServerMiddleware?

I created a serverMiddleware in my Nuxt app that makes this call for example, /api/fetch?url=<user_submitted_url>. While it works on Heroku, my app gives me 404 error whenever it tries to make that call.

I've tried added fallback: true to generate in the config with no luck.

Do you encounter this before?

Collapse
 
debs_obrien profile image
Debbie O'Brien

Hey, not come across that no. Did you manage to fix t?

Collapse
 
swsalim profile image
Yuyu

Yea. Apparently, these issues aren't related. The serverMiddleware doesn't work on static hosting hence it doesn't work on Netlify. I replaced the serverMiddleware with Netlify functions.

Thread Thread
 
debs_obrien profile image
Debbie O'Brien

Nice 👏