Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save seyofori/8c828485c8d6f01d561d9d57f4438ff7 to your computer and use it in GitHub Desktop.

Select an option

Save seyofori/8c828485c8d6f01d561d9d57f4438ff7 to your computer and use it in GitHub Desktop.
HOW TO FIX "413 Payload too large" in NodeJS (Express)
const express = require('express');
const bodyParser = require('body-parser');
...
// Express 4.0
app.use(bodyParser.json({ limit: '10mb' }));
app.use(bodyParser.urlencoded({ extended: true, limit: '10mb' }));
// Express 3.0
app.use(express.json({ limit: '10mb' }));
app.use(express.urlencoded({ limit: '10mb' }));
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment