mean.io - Error: 'Request entity too large'. How to increase bodyParser limit outside meanio module?

Ravi Samanthapudi picture Ravi Samanthapudi · Apr 29, 2015 · Viewed 16.7k times · Source

I am receiving following error with mean.io application.

Error: request entity too large

To overcome this issue, I have increased the bodyParser limit with in meanio module at following location.

node_modules/meanio/lib/core_modules/server/ExpressEngine.js

However this is a bad practice and the changes will be lost if we upgrade the module. Can anyone suggest any alternative way to increase request limit at meanio app?

Answer

Zachary Dahan picture Zachary Dahan · Apr 30, 2015

Try to apply this in your app.js instead.

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

Hope this help!