Skip to content

Commit

Permalink
feat: add behaviour option to remap paths
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOrangePuff committed Sep 13, 2024
1 parent d39a8e1 commit 1ced5b3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/static-hosting/lib/static-hosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ export interface StaticHostingProps {

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

/**
* Paths to remap on the default behaviour. For example you might remap deployed_sitemap.xml -> sitemap.xml
Expand Down Expand Up @@ -295,6 +295,7 @@ export interface StaticHostingProps {
interface remapPath {
from: string;
to?: string;
behaviour?: Partial<BehaviorOptions>;
}

export interface ResponseHeaderMappings {
Expand Down Expand Up @@ -530,6 +531,7 @@ export class StaticHosting extends Construct {
origin: backendOrigin,
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
edgeLambdas: this.createRemapBehavior(path.from, path.to),
...path.behaviour,
};
}
}
Expand All @@ -553,6 +555,7 @@ export class StaticHosting extends Construct {
origin: s3Origin,
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
edgeLambdas: this.createRemapBehavior(path.from, path.to),
...path.behaviour,
};
}
}
Expand Down

0 comments on commit 1ced5b3

Please sign in to comment.