From bf8a181787270e953870aebb1e2bf9d40114e38d Mon Sep 17 00:00:00 2001 From: Nick Santos Date: Tue, 17 Feb 2015 12:13:56 -0500 Subject: [PATCH 1/2] Add mechanisms to configure middleware --- src/matador.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/matador.js b/src/matador.js index 846d942..95156bb 100644 --- a/src/matador.js +++ b/src/matador.js @@ -258,14 +258,14 @@ var createApp = function (baseDir, configuration) { // stupid body parser is stupid (doesn't check for http method in current // connect version, manually create body parser from the 3 child methods) - var jsonParser = connect.json({limit: '10mb'}) + var jsonParser = connect.json(app.get('configMiddlewareJson', {limit: '10mb'})) app.use(function (req, res, next) { req.body = {} if (req.method == 'GET' || req.method == 'HEAD') return next() return jsonParser(req, res, next) }) - app.use(connect.urlencoded({limit: '10mb'})) - app.use(connect.multipart()) + app.use(connect.urlencoded(app.get('configMiddlewareUrlEncoded', {limit: '10mb'}))) + app.use(connect.multipart(app.get('configMiddlewareMultipart', null))) app.use(preRouter.bind(null, app)) From 910a1f207b72107f8e64ef24d9b07c96747ea6b8 Mon Sep 17 00:00:00 2001 From: Nick Santos Date: Tue, 17 Feb 2015 14:31:10 -0500 Subject: [PATCH 2/2] bump version # --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f888d77..f8895bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "matador", "description": "an MVC framework for Node", - "version": "2.0.0-alpha.8", + "version": "2.0.0-alpha.9", "homepage": "https://github.com/Medium/matador", "main": "src/matador.js", "authors": [