diff --git a/index.js b/index.js index c1fa3bd..5d6827d 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,7 @@ const http = require('http') const config = require('config') const app = require('connect')() +const bodyParser = require('body-parser') const swaggerTools = require('swagger-tools') const jsyaml = require('js-yaml') @@ -26,6 +27,10 @@ const options = { const spec = fs.readFileSync(path.join(__dirname, 'api/swagger.yaml'), 'utf8') const swaggerDoc = jsyaml.safeLoad(spec) +// Extending payload size +app.use(bodyParser.json({limit: '10mb', extended: true})) +app.use(bodyParser.urlencoded({limit: '10mb', extended: true})) + // Initialize the Swagger middleware swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) { // Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain