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 882fc34
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/static-hosting/lib/static-hosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export interface StaticHostingProps {
*
* @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 882fc34

Please sign in to comment.