mirror of
https://github.com/dap-ps/discover.git
synced 2025-02-07 23:15:09 +00:00
20 lines
445 B
JavaScript
20 lines
445 B
JavaScript
let bodyParser = require('body-parser');
|
|
|
|
class BodyParserMiddleware {
|
|
|
|
static appendTo(app) {
|
|
|
|
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
|
|
|
|
// only json-type requests are valid
|
|
app.use(bodyParser.json({
|
|
limit: '50mb',
|
|
extended: true,
|
|
type: function () {
|
|
return true;
|
|
}
|
|
}));
|
|
}
|
|
}
|
|
|
|
module.exports = BodyParserMiddleware; |