File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ jsonApi.setConfig({
2626 // (optional) meta can be a function to be invoked at the end of every request
2727 meta : function (request ) {
2828 return { timestamp: new Date () };
29+ },
30+ // (optional) bodyParserJsonOpts allows setting the options passed to the json body parser,
31+ // such as the maximum allowed body size (default is 100kb). All the options are
32+ // documented at https://github.com/expressjs/body-parser#bodyparserjsonoptions
33+ bodyParserJsonOpts: {
34+ limit: ' 256kb' ,
2935 }
3036});
3137```
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ router.applyMiddleware = () => {
6666 return next ( )
6767 } )
6868
69- app . use ( bodyParser . json ( ) )
69+ app . use ( bodyParser . json ( jsonApi . _apiConfig . bodyParserJsonOpts ) )
7070 app . use ( bodyParser . urlencoded ( { extended : true } ) )
7171 app . use ( cookieParser ( ) )
7272 if ( ! jsonApi . _apiConfig . router ) {
You can’t perform that action at this time.
0 commit comments