Skip to content

Instantly share code, notes, and snippets.

@brianedgerton
Created March 20, 2013 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianedgerton/9cef3bf2634a3b17d956 to your computer and use it in GitHub Desktop.
Save brianedgerton/9cef3bf2634a3b17d956 to your computer and use it in GitHub Desktop.
Connect Middleware Issue
var connect = require( "connect" ),
flatiron = require( "flatiron" ),
app = flatiron.app;
app.use( flatiron.plugins.http, {
buffer: false,
before: [
connect.bodyParser(),
function( req, res ) {
// This works fine here
console.log( req.body );
res.emit( 'next' );
}
]
})
app.router.get( '/someroute', function() {
console.log( this.req.body ); // Empty object
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment