Skip to content

Commit 10a7ba6

Browse files
committed
fix(app): set the leading slash for pattern matching
1 parent 87b2ef2 commit 10a7ba6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

application/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function greet(name) {
1717
async function routeHandler(event, context) {
1818
const { pathRaw, httpMethod } = event;
1919
const pathPrefix = process.env.PATH_PREFIX || "/hello";
20-
const path = pathRaw.replace(pathPrefix, "");
20+
const path = pathRaw.replace(pathPrefix, "") || "/";
2121
const routeKey = `${path}_${httpMethod}`;
2222

2323
switch (routeKey) {

infra/repository/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
data "aws_caller_identity" "current" {}
12
data "aws_region" "current" {}
23

34
resource "github_branch_protection" "this" {
@@ -47,3 +48,11 @@ resource "github_actions_environment_variable" "this" {
4748
variable_name = "AWS_REGION"
4849
value = data.aws_region.current.name
4950
}
51+
52+
resource "github_actions_environment_secret" "aws_account_id" {
53+
repository = "aws-lambda-opentofu-github-actions"
54+
55+
environment = github_repository_environment.this.environment
56+
secret_name = "AWS_ACCOUNT_ID"
57+
plaintext_value = data.aws_caller_identity.current.account_id
58+
}

0 commit comments

Comments
 (0)