Skip to content

Commit

Permalink
feat: add static file remap options
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOrangePuff committed Sep 13, 2024
1 parent 4d62d2a commit d39a8e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/static-hosting/lib/static-hosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ export interface StaticHostingProps {
*/
enableStaticFileRemap?: boolean;

/**
* Optional additional properties for static file remap behaviours
*
* @default none
*/
staticFileRemapOptions?: BehaviorOptions;

/**
* Paths to remap on the default behaviour. For example you might remap deployed_sitemap.xml -> sitemap.xml
* Created a behaviour in CloudFront to handle the remap. If the paths are different
Expand Down Expand Up @@ -533,6 +540,7 @@ export class StaticHosting extends Construct {
additionalBehaviors[`*.${path}`] = {
origin: s3Origin,
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
...props.staticFileRemapOptions,
};
}
}
Expand Down

0 comments on commit d39a8e1

Please sign in to comment.