Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion backend/src/iac/backend-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ export class BackendStack extends cdk.Stack {
// Create the 'status' resource under ':id'
const reportStatusResource = reportIdResource.addResource('status');

// Create the 'process-file' resource under ':id'
const processFileResource = reportIdResource.addResource('process-file');

// Define integration options once for reuse
const integrationOptions = {
connectionType: apigateway.ConnectionType.VPC_LINK,
Expand Down Expand Up @@ -465,7 +468,7 @@ export class BackendStack extends cdk.Stack {
});

// Add POST method to process file
reportIdResource.addMethod('POST', processFileIntegration, {
processFileResource.addMethod('POST', processFileIntegration, {
...methodOptions,
requestParameters: {
'method.request.path.id': true,
Expand Down Expand Up @@ -506,6 +509,10 @@ export class BackendStack extends cdk.Stack {
...corsOptions,
allowCredentials: false,
});
processFileResource.addCorsPreflight({
...corsOptions,
allowCredentials: false,
});

// Configure Gateway Responses to add CORS headers to error responses
const gatewayResponseTypes = [
Expand Down
Loading