0.1.0 • Published 4 years ago

pambda-binary-support v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

pambda-binary-support

Pambda for binary support.

Installation

npm i pambda-binary-support -S

Usage

const { compose, createLambda } = require('pambda');
const { binarySupport } = require('pambda-binary-support');

export const handler = createLambda(
  compose(
    binarySupport({
      binaryMediaTypes: [ 'image/*' ],
    }),
    // other pambdas
  )
);

binarySupport(options)

  • options.binaryMediaTypes
    • An array of media types that the binary support is enabled.
    • If this option is not specified, the media types are obtained by calling getRestApi of API Gateway.

if options.binaryMediaTypes is omitted, a lambda execution role must be granted permission to call getRestApi. It means the role has the following policy document.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "apigateway:GET"
      ],
      "Resource": [
        "arn:aws:apigateway:{REGION}::/restapis/{APIID}"
      ]
    }
  ]
}

License

MIT

0.1.0

4 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago