I'm in the process of rebuilding a PHP app in Node.js on top of the Express framework.
One part of the application is a callback url that an Amazon SNS notification is posted to.
The POST body from SNS is currently read in the following way in PHP (which works):
$notification = json_decode(file_get_contents('php://input'));
In Express I have tried the following:
app.post('/notification/url', function(req, res) {
console.log(req.body);
});
However, watching the console, this only logs the following when the post is made:
{}
So, to repeat the question: How do you access an Amazon SNS post body with Express / Node.js