pambda-binary-support

0.1.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    1
    • latest

Version History

Package Sidebar

Install

npm i pambda-binary-support

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

4.98 kB

Total Files

5

Last publish

Collaborators

  • nak2k