Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
[[redirects]] rules not working as expected on netlify.toml file
I have some serverless functions setup in netlify. The default API endpoint look like: š /.netlify/functions/fun I want to customize these URLs to something like: š /api/fun But I'm getting error "cannot find module ...../api" This is my netlify.toml file. [build] Ā functions = "lambda" [[redirects]] Ā from = "/api/fun" Ā to = "/.netlify/functions/fun" Ā status = 200 Ā force = true What is the problem here. Help if you have any any experience with this.
1 Resposta
0
Never used netlify so I'm not actually sure but try swapping values of 'from' and 'to' fields.
...
[[redirects]]
from = "/.netlify/functions/fun"
to = "/api/fun"
...