-
-
Save ardeshir/b4559037a0ca8964e47f9764b4eb2298 to your computer and use it in GitHub Desktop.
AWS API Gateway content compression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: | |
name: compress-content-tutorial | |
plugins: | |
- serverless-api-compression | |
- serverless-webpack | |
- serverless-offline | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: test | |
region: eu-west-1 | |
environment: ${file(env.yml):${self:custom.stage}} | |
deploymentBucket: aws-account-id.serverless.deploys | |
stackTags: ${file(tags.yml):${opt:stage}.stack} | |
iamRoleStatements: | |
- Effect: Allow | |
Action: S3:* | |
Resource: arn:aws:s3:::* | |
custom: | |
stage: ${opt:stage, self:provider.stage} | |
contentEncoding: | |
contentCompression: 100 # Minimum body size required for compression in bytes | |
functions: | |
getPosts: | |
handler: src/posts/handler.getPosts | |
memorySize: 1024 | |
timeout: 10 | |
events: | |
- http: | |
path: messages | |
method: get | |
cors: true | |
request: | |
parameters: | |
paths: | |
type: false | |
package: | |
individually: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment