I am trying to write a very simple project, of writing a web from and send it to node js, so I can save the information I get there.
What am I missing?
thank you so much Idan
CodePudding user response:
So you’ve set up urlencodedParser
but you forgot to add it to your middleware:
var urlencodedParser = bodyParser.urlencoded({ extended: true })
app.use(urlencodedParser);
CodePudding user response:
body-parser
is deprecated, you can use express
to specify your middleware like so:
app.use(express.urlencoded({ extended: true }));
urlencoded is the parser you need to parse HTML form data.