Socket
Book a DemoInstallSign in
Socket

serverless-apigateway-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-apigateway-plugin

this is the serverless plugin to customize the aws api gateway

0.0.6
latest
Source
npmnpm
Version published
Weekly downloads
670
-3.18%
Maintainers
1
Weekly downloads
 
Created
Source

serverless-APIGateway-plugin

Serverless framework plugin to configure the AWS api gateway

  • Binary support
  • Headers
  • Body template mappings

Currently it is used in GFG(Global Fashion Group) internal projects.

Installation

Install the plugin from npm

$ npm install --save serverless-apigateway-plugin

Usage

Add the plugin to your serverless.yml

# serverless.yml

plugins:
  - serverless-apigateway-plugin

Add the config to your custom tag of serverless.yml,

For headers: pls follow the spec at AWS JS SDK putGatewayResponse For body mapping templates: pls follow the spec at AWS JS SDK updateGatewayResponse

# serverless.yml

custom:
  apigateway:
    responses:
    -  response:
         type: ACCESS_DENIED
         headers: {"gatewayresponse.header.Access-Control-Allow-Origin":"'*'"}
         bodyMappingTemplate: { "contentType": "application/json" , "content": '{"status": 403,"code": "INVALID_TOKEN","detail":$context.error.messageString}'}
         statusCode: 403
    binaryTypes:
      - 'image/jpg'
      - 'text/html'

Contributing

We welcome pull requests! Please fork the repo and submit your PR.

Keywords

serverless

FAQs

Package last updated on 17 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.