node.js 的express服务器报 413 payload too large

node.js 的express服务器报 413 payload too large

 

修改做法:

1 express 4.0 前版本

 

app.use(express.json({limit: '50mb'}));
app.use(express.urlencoded({limit: '50mb'}));

 

2. express 4.0后版本

 

var bodyParser = require('body-parser');
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));

 

 

 

你可能感兴趣的:(nodeJs)