Hi, I am new to Netlify and serverless functions. My purpose for trying to use the PlanetScale integration is to submit data entered from a form into the database.
I was following along with the document linked here
Everything has been successfully configured up until the section “Create a function to call PlanetScale”.
I installed the dependencies as asked under my project’s root directory. I was confused about where to implement the withPlanetScale function so I referred to the document here about creating functions.
Before I go any further, I want to say I have no prior experience with TypeScript, however, I referred to the TypeScript section of the link since the example given on the PlanetScale Integration link was TypeScript.
I set up the tsconfig file as requested as well as enabling the properties specified. I placed this file directly in the functions folder under project-root/node_modules/netlify/functions.
Next, I created the function file as specified under the same directory using the example given in the PlanetScale doc.
Now, I am confused about how I should call this function. I know in the functions doc it says it can be called using /.netlify/functions/hello
endpoint (Of course replacing hello with the name of my function file). Although, I am unsure of what I should use to call this.
I would appreciate any help with this or even pointing me in the right direction if there are things I should learn before going forward with this. Thank you!