From b959298a80dc8d2880badc04279d6d511951ef58 Mon Sep 17 00:00:00 2001 From: Shane Earley Date: Mon, 30 Oct 2023 22:35:31 -0400 Subject: [PATCH] Fix bug in cloudfront function source --- services/redirect/README.md | 3 +++ services/redirect/build.js | 2 +- services/redirect/src/index.ts | 10 +++------- services/users/README.md | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 services/redirect/README.md diff --git a/services/redirect/README.md b/services/redirect/README.md new file mode 100644 index 000000000..e6f7e11c2 --- /dev/null +++ b/services/redirect/README.md @@ -0,0 +1,3 @@ +# @casimir/redirect + +> Casimir cloudfront functions redirect service \ No newline at end of file diff --git a/services/redirect/build.js b/services/redirect/build.js index 53bd1759d..ab697485b 100644 --- a/services/redirect/build.js +++ b/services/redirect/build.js @@ -5,7 +5,7 @@ esbuild.build({ entryPoints: ['src/index.ts'], outfile: 'dist/index.js', minify: false, - sourcemap: true, + sourcemap: false, platform: 'node', target: 'esnext' }) \ No newline at end of file diff --git a/services/redirect/src/index.ts b/services/redirect/src/index.ts index 2e8e83344..f73c83c58 100644 --- a/services/redirect/src/index.ts +++ b/services/redirect/src/index.ts @@ -1,11 +1,7 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars function handler(event: AWSCloudFrontFunction.Event) { - const request = event.request - - const uri = request.uri - if (!uri.includes('.')) { - request.uri += '.html' + if (!event.request.uri.includes('.')) { + event.request.uri += '.html' } - - return request + return event.request } \ No newline at end of file diff --git a/services/users/README.md b/services/users/README.md index 9dc2d40cd..c8f1fb578 100644 --- a/services/users/README.md +++ b/services/users/README.md @@ -1,6 +1,6 @@ # @casimir/users -Casimir users service +> Casimir users service and database ## Development