I'm starting in NodeJS and to practice I'm creating a project where I have a form with some fields, the form is created inside the views folder as teste.ejs .
I would like when submitting via POST the infos of these fields would be popular a JSON structure inside other test.js files and execute it printing the response either in the console or on another page .ejs.
So far I can print the form values and retrieve them using the body-parser, but I'm having a hard time with the other .js file.