Skip to content

Instantly share code, notes, and snippets.

@ardeshir
Forked from OneMuppet/serverless.yml
Created March 18, 2019 18:33
Show Gist options
  • Save ardeshir/b4559037a0ca8964e47f9764b4eb2298 to your computer and use it in GitHub Desktop.
Save ardeshir/b4559037a0ca8964e47f9764b4eb2298 to your computer and use it in GitHub Desktop.
AWS API Gateway content compression
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