Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #29 from BonnierNews/body-size-limit
Browse files Browse the repository at this point in the history
Config for body-parser limit
  • Loading branch information
maxolofsson1 authored Feb 23, 2022
2 parents f316579 + bb45c0f commit 30accba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function init() {
app.use(appendRawBody);
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.text({type: "text/*"}));
app.use(bodyParser.json({limit: "200kb"}));
const limit = (config.express && config.express.body && config.express.body.limit) || "200kb";
app.use(bodyParser.json({limit}));

// Don't limit the number of outgoing HTTP requests (defaults to 4 simultaneous requests)
http.globalAgent.maxSockets = Infinity;
Expand Down
5 changes: 5 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"port": 3000,
"viewCaching": false,
"HOSTNAME": "development-pod",
"express": {
"body": {
"limit": "200kb"
}
},
"postgres": {
"user": "crm",
"password": "crm",
Expand Down

0 comments on commit 30accba

Please sign in to comment.