Hi there,
These are some of the contexts:
- Site name: https://dancing-praline-bab7d9.netlify.app
- DNS issues: N/A
- I did try asking the bot but it did not really answer my questions.
- This is my repo:https://github.com/keduong33/test
*Context: I am using Netlify Functions 2.0 with React (Vite) and customise some of my endpoints, for example /healthcheck
. To avoid getting 404 when I refresh the SPA, I added the redirect into my netlify.toml.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
It seems to work fine with netlify dev
but when I deployed, my functions would not run but instead it would return the index.html when called. Is there a correct way to fix it? Cause right now I am thinking of adding another redirect and add an extra âlayerâ to the endpoint like api/healthcheck
then for the redirect
[[redirects]]
from = "/api/*"
to = "/api/:splat" --> Please let me know if this is the correct syntax/format/way
status = 200
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
Thank you for your help in advance