I've set up a working, very simple express server with ejs as my view engine.
My web page has a form, and with the press of an html button the input is turned into the json object userFormData. I have another node.js file that handles interactions with an API. On this file, I have a function createNewFromUserFormData(userFormData). I now wonder what the best way would be to get my userFormData from the front end, to the API handling js node on the back end. Is there any way I can call a function on the node from the frontend index.ejs in the view folder?
Basically my question is just: How can I export json from the webapp to a node server? Is there any way I can call a function on the backend from a onclick on the index.ejs?