Ok, first thing I would suggest is to check your netlify.toml file and make sure the redirect is setup correctly:
[build]
functions = "functions"
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
But without seeing your code I’m a bit in the dark. So if you post your code on stackoverflow and send me a link to the question, or a direct link to your GitHub repo I can help troubleshoot
can get this working on netlify dev but not on the deployed version... Any suggestions. It also does not work when running a standard npm start
Strange - do you have more detail? E.g. any error messages, the Netlify function logs etc? Link to a repo?
I basically just get a 404 post error even when running with npm start. Works perfectly when using netlify dev
Ok, first thing I would suggest is to check your netlify.toml file and make sure the redirect is setup correctly:
[build]
functions = "functions"
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
But without seeing your code I’m a bit in the dark. So if you post your code on stackoverflow and send me a link to the question, or a direct link to your GitHub repo I can help troubleshoot
I guess the other thing to try is to reference the fully qualified production URL - https://[your app name].netlify.app/api and see if that works