How to extract POST data in node.js?

Submitted by: Administrator
If you use Express (High performance, high class web development for Node.js), you can do this:

HTML:

<form method="post" action="/">
<input type="text" name="user[name]">
<input type="text" name="user[email]">
<input type="submit" value="Submit">
</form>

Javascript:

app.use(express.bodyParser();

app.post('/', function(request, response){

console.log(request.body.user.name);
console.log(request.body.user.email);

});
Submitted by: Administrator

Read Online Node.js Job Interview Questions And Answers