jaywcjlove/mocker-api

需要可配置bodyParser的limit

qjekingstar opened this issue · 1 comments

默认的是100k, 希望能改成可配置的,谢谢

let bodyParserMethd = bodyParser.json({ limit });
const contentType = req.get('Content-Type');
if (contentType === 'text/plain') {
	bodyParserMethd = bodyParser.raw({limit,  type: 'text/plain' });
} else if (contentType === 'text/html') {
	bodyParserMethd = bodyParser.text({limit, type: 'text/html' });
} else if (contentType === 'application/x-www-form-urlencoded') {
	bodyParserMethd = bodyParser.urlencoded({ limit, extended: false });
}

@qjekingstar Upgrade + mocker-api@1.6.8