I am curious how others might add a form handler for a contact form set up in a Gatsby src/pages or src/components directory. I can see Netlify or Formspree are popular solutions where a url is passed in the form action. I don’t want to get in the habit of using those resources (Netlify/Formspree), I have my reasons. I prefer to use server side resources. For now, I manually add a form-handler.php to the /public directory and then send that via SSH to the document root on the server. It works, but I’m dubious about my method and looking for reassurance? What would you recommend? Thanks for any direction. I sincerely appreciate it.
Thanks Zac. For now I added form-handler.php to a /static directory. Given that files in the /static directory are compiled into the /public root, it was a good solution for the time being. The form-action posts to the form-handler.php and all works great. I am interested is doing this in a way that is more along the lines of what “should” be protocol for react.js. But then, I’m constantly adapting.