acklen-keystone
Version:
Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose
17 lines (15 loc) • 486 B
JavaScript
var multer = require('multer');
var bodyParser = require('body-parser');
module.exports = function bindIPRestrictions (keystone, app) {
// Set up body options and cookie parser
var bodyParserParams = {};
if (keystone.get('file limit')) {
bodyParserParams.limit = keystone.get('file limit');
}
app.use(bodyParser.json(bodyParserParams));
bodyParserParams.extended = true;
app.use(bodyParser.urlencoded(bodyParserParams));
app.use(multer({
includeEmptyFields: true,
}));
};