How to use a form to send data to a .JS file

0

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.

    
asked by anonymous 30.04.2018 / 20:43

0 answers