@@ -372,6 +372,10 @@ export class BackendStack extends cdk.Stack {
372372 // Create the 'status' resource under ':id'
373373 const reportStatusResource = reportIdResource . addResource ( 'status' ) ;
374374
375+ // Create the 'status' resource under ':id'
376+ const documentProcessorResource = apiResource . addResource ( 'document-processor' ) ;
377+ const processFileResource = documentProcessorResource . addResource ( 'process-file' ) ;
378+
375379 // Define integration options once for reuse
376380 const integrationOptions = {
377381 connectionType : apigateway . ConnectionType . VPC_LINK ,
@@ -465,12 +469,7 @@ export class BackendStack extends cdk.Stack {
465469 } ) ;
466470
467471 // Add POST method to process file
468- reportIdResource . addMethod ( 'POST' , processFileIntegration , {
469- ...methodOptions ,
470- requestParameters : {
471- 'method.request.path.id' : true ,
472- } ,
473- } ) ;
472+ processFileResource . addMethod ( 'POST' , processFileIntegration , methodOptions ) ;
474473
475474 // Add CORS to each resource separately - after methods have been created
476475 const corsOptions = {
@@ -506,6 +505,10 @@ export class BackendStack extends cdk.Stack {
506505 ...corsOptions ,
507506 allowCredentials : false ,
508507 } ) ;
508+ processFileResource . addCorsPreflight ( {
509+ ...corsOptions ,
510+ allowCredentials : false ,
511+ } ) ;
509512
510513 // Configure Gateway Responses to add CORS headers to error responses
511514 const gatewayResponseTypes = [
0 commit comments