Skip to content

Adds a POST body-parser middleware to Meteor's internal WebApp server

Notifications You must be signed in to change notification settings

gjr-qm/body-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Add a POST body-parser middleware to the internal WebApp server

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.

How do you make it work?

Install the pbastowski:body-parser package and the above example will work as shown.

Install:

meteor add pbastowski:body-parser

About

Adds a POST body-parser middleware to Meteor's internal WebApp server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%