Home > Blockchain >  Submit html form to nodejs
Submit html form to nodejs

Time:12-20

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.

so, I use some enter image description here

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);

Docs

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.

  • Related