I am working with expressjs 4.12.3, and trying to connect to connect-busboy, but on request I am not able to get req.busboy object, it says "undefined" my simple code is as follows :
var express=require('express');
var busboy = require('connect-busboy');
var app=express();
app.use(busboy());
app.use(function(req, res, next) {
req.busboy.on('field', function(fieldname, val) {
// console.log(fieldname, val);
req.body[fieldname] = val;
});
req.busboy.on('finish', function(){
next();
});
});
app.listen(5555);
I have initialize busboy module, assigned it to the app, also sending content-length: "5276" content-type:'application/x-www-formurlencoded' as headers.
what am I doing wrong??