Sometimes you might want to accept url-encoded form POST requests on your Meteor WebApp server, without using Iron Router, such as in the code below:
var Fiber = Npm.require('fibers');
WebApp.connectHandlers
.use('/mail', function (req, res) {
var that = this;
Fiber(function () {
var body = req.body;
...
}).run();
});
This unfortunately does not work out of the box, because there is no body-parser middleware included in the standard Meteor WebApp configuration.
Install the pbastowski:body-parser
package and the above example will work as shown.
meteor add pbastowski:body-parser