I’m new to Netlify and I’ve created a Netlify function (inviteUser) which I’m able call from my application. This works great in production mode, but I would like to be able to use it in development mode too.
The function is located in /netlify/functions. I’ve installed the Netlify CLI and configured a netlify.toml file in my root directory to specify the functions directory:
[build]
functions = "netlify/functions"
When I attempt to use the function when running in dev mode with “netlify dev” I receive an error:
“POST http://localhost:3000/.netlify/functions/inviteUser 500 (Internal Server Error)”
I cam attempting to use the function like so:
fetch('/.netlify/functions/inviteUser', { ... })
I’m not sure how to get this working in dev mode. What am I doing wrong?