Saturday, 1 August 2020

Is a template engine really necessary when creating post requests?

Ive just started learning node. Im in the process of creating a simple form, that post data from user input when submitted. For the life of me I cant find a way to render the html form without a template engine. For example with a template engine like pug in my app.js file I can just put:app.post("/form", (req, res) => { res.render("form"); });and it will render the form page for me so that I can test it on my local server. Is there any way to render my form when its not a template file like "form.pug". What if I dont want to use a template engine, and just want to render my "form.html" ?

Submitted August 02, 2020 at 04:18AM by subconix

No comments:

Post a Comment