From bdff1fd0f27fb23f12e37fac669cb3cd2a69a2c0 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 11 Dec 2018 11:12:53 +0530 Subject: [PATCH 1/4] trying compression with metadata list endpoint --- package.json | 1 + src/routes/index.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/package.json b/package.json index c11b8b8b..76a0a1df 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "bluebird": "^3.4.1", "body-parser": "^1.15.0", "co": "^4.6.0", + "compression": "^1.7.3", "config": "^1.20.1", "continuation-local-storage": "^3.1.7", "cors": "^2.8.4", diff --git a/src/routes/index.js b/src/routes/index.js index 5af5ff89..5c7f3b9f 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -3,6 +3,7 @@ import _ from 'lodash'; import config from 'config'; import validate from 'express-validation'; import { Router } from 'express'; +import compression from 'compression'; const router = Router(); @@ -46,6 +47,8 @@ router.route('/v4/projects/metadata/productCategories') router.route('/v4/projects/metadata/productCategories/:key') .get(require('./productCategories/get')); + +router.use(`/v4/projects/metadata`, compression()); router.route('/v4/projects/metadata') .get(require('./metadata/list')); From 188ba438190bbb73af784a0e48c85727527b3387 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 11 Dec 2018 11:13:42 +0530 Subject: [PATCH 2/4] making hot fix branch deployable to test in dev --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 459ec723..2b1bc644 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,7 +76,7 @@ workflows: - test filters: branches: - only: ['dev'] + only: ['dev', 'hotfix/gzip_compression'] - deployProd: requires: - test From 9f81b6e8559b9057e5b92b403ea666e61af233b1 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 11 Dec 2018 11:18:21 +0530 Subject: [PATCH 3/4] lint fix --- src/routes/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/index.js b/src/routes/index.js index 5c7f3b9f..469c2c2f 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -48,7 +48,7 @@ router.route('/v4/projects/metadata/productCategories/:key') .get(require('./productCategories/get')); -router.use(`/v4/projects/metadata`, compression()); +router.use('/v4/projects/metadata', compression()); router.route('/v4/projects/metadata') .get(require('./metadata/list')); From 2945905457c076b1119eadbfd1084db54813836a Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 11 Dec 2018 11:32:42 +0530 Subject: [PATCH 4/4] Removed temporary deployable hot fix branch --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b1bc644..459ec723 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,7 +76,7 @@ workflows: - test filters: branches: - only: ['dev', 'hotfix/gzip_compression'] + only: ['dev'] - deployProd: requires: - test