Skip to content

Commit

Permalink
Fix githubEndpoint trigger resource (#893)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayangler authored Aug 24, 2023
1 parent 6cff3a4 commit e0741c7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cdk-infra/lib/constructs/api/webhook-api-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ export class WebhookApiConstruct extends Construct {
const localEndpoint = webhookEndpoint.addResource('local');
const snootyEndpoint = webhookEndpoint.addResource('snooty');

// Shared /githubEndpoint/trigger endpoint
const githubEndpointTrigger = githubEndpoint.addResource('trigger');

const defaultCorsPreflightOptions: CorsOptions = {
allowOrigins: Cors.ALL_ORIGINS,
};
Expand All @@ -153,13 +156,11 @@ export class WebhookApiConstruct extends Construct {
.addResource('upsert', { defaultCorsPreflightOptions })
.addMethod('POST', new LambdaIntegration(dochubTriggerUpsertLambda));

githubEndpoint
.addResource('trigger')
githubEndpointTrigger
.addResource('build', { defaultCorsPreflightOptions })
.addMethod('POST', new LambdaIntegration(githubTriggerLambda));

githubEndpoint
.addResource('trigger')
githubEndpointTrigger
.addResource('delete', { defaultCorsPreflightOptions })
.addMethod('POST', new LambdaIntegration(githubDeleteArtifactsLambda));

Expand Down

0 comments on commit e0741c7

Please sign in to comment.