Skip to content

Commit

Permalink
Fix bug in cloudfront function source
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Oct 31, 2023
1 parent d266453 commit b959298
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 3 additions & 0 deletions services/redirect/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @casimir/redirect

> Casimir cloudfront functions redirect service
2 changes: 1 addition & 1 deletion services/redirect/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ esbuild.build({
entryPoints: ['src/index.ts'],
outfile: 'dist/index.js',
minify: false,
sourcemap: true,
sourcemap: false,
platform: 'node',
target: 'esnext'
})
10 changes: 3 additions & 7 deletions services/redirect/src/index.ts
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion services/users/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @casimir/users

Casimir users service
> Casimir users service and database
## Development

Expand Down

0 comments on commit b959298

Please sign in to comment.