Skip to content

Instantly share code, notes, and snippets.

@cal0610
Created November 1, 2022 10:08
Show Gist options
  • Save cal0610/85ec8c4ca891a0e18424dadef863a096 to your computer and use it in GitHub Desktop.
Save cal0610/85ec8c4ca891a0e18424dadef863a096 to your computer and use it in GitHub Desktop.
lambda integration
const getAllIntegration = new LambdaIntegration(getAllLambda, {proxy: true});
const createOneIntegration = new LambdaIntegration(createOneLambda, {proxy: true});
const getOneIntegration = new LambdaIntegration(getOneLambda, {proxy: true});
const updateOneIntegration = new LambdaIntegration(updateOneLambda, {proxy: true});
const deleteOneIntegration = new LambdaIntegration(deleteOneLambda, {proxy: true});
const store = api.root.addResource('store');
store.addMethod('POST', createOneIntegration);
store.addMethod('GET', getAllIntegration);
const singleStore = store.addResource('{id}');
singleStore.addMethod('GET', getOneIntegration);
singleStore.addMethod('PATCH', updateOneIntegration);
singleStore.addMethod('DELETE', deleteOneIntegration);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment