Skip to content

Instantly share code, notes, and snippets.

@maggocnx
Created September 7, 2013 06:52
Show Gist options
  • Save maggocnx/6473422 to your computer and use it in GitHub Desktop.
Save maggocnx/6473422 to your computer and use it in GitHub Desktop.
Show post Data in express
app.use (function(req, res, next) {
var data='';
req.setEncoding('utf8');
req.on('data', function(chunk) {
data += chunk;
});
req.on('end', function() {
console.log(data);
jsonData = JSON.parse(data);
console.log(jsonData);
req.body = jsonData;
next();
});
});
app.use(app.router);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment