lambda-proxy-integration
AWS API Gateway Lambda Proxy Integration middleware
API Gateway
set resource path like your folder structure and vice-versa
GET /user/friendlist will map to: /path-to-your-lambda-function-root/user/friendlist/GET.js
Lambda Integration
Inside your file you have to export a Promise:
// File: /resources/user/friendlist/GET.js module { return { if /*some errors*/ // the params of "reject" will be passed to the error function return ; // the params of "resolve" will be passed to the response function ; };};
In the root of lambda function, you export the integration created like this:
// File: /index.js var createIntegration = ; const lambdaProxyIntegration = ; exportshandler = lambdaProxyIntegration;