-
-
Save shubham7298/816fc366b51bce6c626c635c4f2c71c2 to your computer and use it in GitHub Desktop.
When you face an error 413 Payload too large in NodeJS, use this to fix that out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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