I am new to creating servers with node. My application needs to get input from front end (by html input fields) and to write that to server.js file with simple (button 'onclick') function that I had created in a file called script.js. A script.js file and that function are exported to server.js, but cannot be used cause node.js cannot support DOM. In my server.js file, I have allready imported fs, filePath, http and express modules. Then, I've made a simple server that can be used to read content(fs.readFile()), but not to write it (fs.writeFile()) - as I want. In node command prompt, I'm getting errors like 'input field undefined', 'document.getElementById undefined', etc...
So, what can I do to write json file with values (strings) that are collected from html input fields/tags?