Forms are widely used in the web to submit or fetch some information for the visitors. Multipart/form-data is a type of encoding. It is important to note that it works only with POST method. This is also important while using uploading files.
// Form Data using GET Method
app.get("/signupdata", (req, res) => {
const data = req.query;
res.render("signupdata", data)
})
// Form Data using POST Method
const bodyParser = require("bodyParser")
app.use(bodyParser.urlencoded({extended:false}))
app.use(bodyParser.json())
app.post("/signupdata", (req, res) => {
res.render("signupdata", req.body)
})
app.listen{4000, () => {
console.log('Server Started..!');
})