Hi Team Netlify Support
My site is https://astro-netlify-sandbox.netlify.app/
Site : astro-netlify-sandbox.netlify.app
My node version is v20.5.0
I am returning to netlify after a long time and I seem to have forgotten everything so it’s a fresh start for me… and I am experimenting with functions…
https://astro-netlify-sandbox.netlify.app/.netlify/functions/hello
As you can see the above code works and I’d like to have that work on my localhost too…
so I ran
netlify dev
and it gives me this message
┃ Local http://localhost:4321/
┃ Network use --host to expose
11:34:18 watching for file changes...
⠇ Waiting for framework port 3000. This can be configured using the 'targetPort' property in the netlify.toml
And then when I try to use the url below it doesn’t work
http://localhost:3000/.netlify/functions/hello
I have this in the netlify.toml
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
[dev]
command = "astro dev"
targetPort = 3000
The netlify.toml file is being read and working fine as you will see that the url below too works on production.
https://astro-netlify-sandbox.netlify.app/api/hello
So the [[redirects]] part from the netlify.toml is being read and used… but for some reason the [dev] part is not working…
I’ve asked your chatbot and also checked the documentation but couldn’t figure out what to do.
Please advise as it seems to work on the production but it’s not working on development.
Regards,
Alim