Skip to content

Commit

Permalink
feat: add retrieving slack request url with given app id
Browse files Browse the repository at this point in the history
  • Loading branch information
Yengas committed Dec 25, 2022
1 parent faecc18 commit 82de429
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 14 deletions.
8 changes: 8 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ const project = new awscdk.AwsCdkConstructLibrary({
npmAccess: NpmAccess.PUBLIC,
description:
"Exposes a Slack Events API Request URL that validates and sends all received events to an AWS Event Bus",
keywords: [
"aws",
"cdk",
"awscdk",
"Amazon EventBridge",
"slack",
"events-api",
],

cdkVersion: MIN_CDK_VERSION,
defaultReleaseBranch: "main",
Expand Down
24 changes: 13 additions & 11 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ export class SlackEventBus extends Construct {
});
}

get slackEventsRequestUrl(): string {
return `${this.httpApi.apiEndpoint}${SlackEventBus.SLACK_EVENTS_PATH}`;
slackEventsRequestUrl(appId?: string): string {
const path =
appId !== undefined
? SlackEventBus.SLACK_EVENTS_PATH.replace("{appId}", appId)
: SlackEventBus.SLACK_EVENTS_PATH;

return `${this.httpApi.apiEndpoint}${path}`;
}

get eventBus(): Events.EventBus {
Expand Down

0 comments on commit 82de429

Please sign in to comment.