From cc4f1118ca1071b6a740563f1de1e8c3b256424e Mon Sep 17 00:00:00 2001 From: Guido Percu Date: Sun, 13 Apr 2025 15:03:05 -0400 Subject: [PATCH] Add POST /api/reports to the API Gateway --- backend/src/iac/backend-stack.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/iac/backend-stack.ts b/backend/src/iac/backend-stack.ts index 42f609b1..2dc8165e 100644 --- a/backend/src/iac/backend-stack.ts +++ b/backend/src/iac/backend-stack.ts @@ -393,6 +393,13 @@ export class BackendStack extends cdk.Stack { options: integrationOptions, }); + const createReportIntegration = new apigateway.Integration({ + type: apigateway.IntegrationType.HTTP_PROXY, + integrationHttpMethod: 'POST', + uri: `${serviceUrl}/api/reports`, + options: integrationOptions, + }); + const getLatestReportIntegration = new apigateway.Integration({ type: apigateway.IntegrationType.HTTP_PROXY, integrationHttpMethod: 'GET', @@ -432,6 +439,7 @@ export class BackendStack extends cdk.Stack { // Add methods to the resources reportsResource.addMethod('GET', getReportsIntegration, methodOptions); + reportsResource.addMethod('POST', createReportIntegration, methodOptions); latestResource.addMethod('GET', getLatestReportIntegration, methodOptions); docsResource.addMethod('GET', getDocsIntegration, methodOptions); // For path parameter methods, add the request parameter configuration