1.0.3 • Published 4 years ago
lambda-helper-integration v1.0.3
lambda-helper-integration
This is a library to help switch from API Gateway proxy integration to normal lambda integration
Installation
Use the package manager pip to install foobar.
yarn add lambda-helper-integration
Usage
var Integration = require("lambda-helper-integration")
export default async (event) => {
var integration = Integration(event,'proxy')
//leave second param empty for normal integration
....
var body = integration.body
// get body
var user= integration.claims
// get userinfo when there is a proxy integration
var user= integration.claims
// get userinfo when there is a proxy integration
Response
return integration.response({data:dataArray})
// response for no proxy integration
return integration.response({data:dataArray},400,{"header1":"headerexample1"})
// response for proxy integration
@copyrights http://horizont.dev/