node js define request structure code example
Example: using multiparty with node js express
var express = require('express');
var multiparty = require('connect-multiparty'),
multipartyMiddleware = multiparty({ uploadDir: './imagesPath' });
var router = express.Router();
router.post('/', multipartyMiddleware, function(req, res) {
console.log(req.body, req.files);
var file = req.files.file;
console.log(file.name);
console.log(file.type);
res.status(200).send('OK');
});
module.exports = router;