on 07-13-2022 4:44 AM
What is the best way to increase the message size limitation on the REST adapter?
Temporarily adjusting line 110 in cds/libx/rest/RestAdapter.js
from -> router.use(express.json()) // REVISIT: -> belongs to the parses
to -> router.use(express.json({limit:"50mb"}))
fixes the problem, but what is the appropriate way of working around that limitation?
Hi Martin,
Currently the only way to increase payload size in REST is to change the limit parameter of the express object during bootstrapping, something like this:
cds.on("bootstrap", (app) => {
app.use(require("express").json({ limit: '10MB' }))
cds.serve("someService").in(app).to("rest").at("rest");
})
Please note that this will work only for REST. We are working on providing a configuration option, that would allow you to set the maximum request body size. To find out, when this functionality will be available, please keep track of our release notes.
Best regards,
Olena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @OlenaT,
Is such a configuration available in the meantime? We're hitting the same issue.
Br,
Tobias
User | Count |
---|---|
82 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.