Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Commit

Permalink
Finalize for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Dong DO HAI committed Jan 2, 2018
1 parent 7de1158 commit 29f2553
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ custom:
This plugin will be triggered during deployment process
```
serverless deploy
$ serverless deploy
```
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ContentEncoding {
* @param {*} minimumCompressionSize Minimum body size required for compression in bytes
*/
enableContentEncoding(apiId, minimumCompressionSize) {
this.serverless.cli.log(`Enabling API Gateway Content Encoding with minimum compression size = ${minimumCompressionSize}`);
this.serverless.cli.log(`Enabling API Gateway Content Encoding with minimum compression size = ${minimumCompressionSize} bytes`);
const patchOperations = [{
op: 'replace',
path: '/minimumCompressionSize',
Expand All @@ -62,7 +62,6 @@ class ContentEncoding {
* @param {*} apiId Target REST Api ID
*/
disableContentEncoding(apiId) {
this.serverless.cli.log('Disabling API Gateway Content Encoding');
const patchOperations = [{
op: 'replace',
path: '/minimumCompressionSize',
Expand All @@ -89,7 +88,7 @@ class ContentEncoding {
const stage = this.options.stage || this.serverless.service.provider.stage;

if (!this.serverless.service.custom.contentEncoding || !this.serverless.service.custom.contentEncoding.minimumCompressionSize) {
return this.getApiId.then(apiId => this.disableContentEncoding(apiId).then(() => this.createDeployment(apiId.stage)));
return this.getApiId(stage).then(apiId => this.disableContentEncoding(apiId).then(() => this.createDeployment(apiId, stage)));
}

const { minimumCompressionSize } = this.serverless.service.custom.contentEncoding;
Expand Down

0 comments on commit 29f2553

Please sign in to comment.