Increase body parser limit

- The default limit is only 100kb
- we are getting many requests that exceed this limit
- not sure about what would be an appropriate limit, but have seen 50mb
  in many examples.
This commit is contained in:
mattwr18 2020-02-10 19:16:41 +01:00
parent 6662f57fba
commit 00195f1615

View File

@ -7,6 +7,7 @@ import { getNeode, getDriver } from './db/neo4j'
import decode from './jwt/decode'
import schema from './schema'
import webfinger from './activitypub/routes/webfinger'
import bodyParser from 'body-parser'
const driver = getDriver()
const neode = getNeode()
@ -45,6 +46,8 @@ const createServer = options => {
app.use(helmet())
app.use('/.well-known/', webfinger())
app.use(express.static('public'))
app.use(bodyParser.json({ limit: '50mb' }))
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }))
server.applyMiddleware({ app, path: '/' })
return { server, app }