Skip to content

Commit

Permalink
use list value
Browse files Browse the repository at this point in the history
  • Loading branch information
gidsg committed Feb 3, 2025
1 parent 8b30fcc commit 1564262
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ Resources:
Properties:
Name: CommunitiesRedirect
AutoPublish: false
FunctionCode: !Sub |
FunctionCode: !Sub
- |
function handler(event) {
const host = event.request.headers.host.value;
const uri = event.request.uri;
var newUrl;
if (host == 'frontend.dev.access-funding.test.levellingup.gov.uk')
newUrl = `https://access.${!FindInMap [DomainSuffixMap, !Ref Env, 'DomainSuffix']}${!uri}`;
newUrl = `https://access.${DomainSuffix}${!uri}`;
var response = {
statusCode: 302,
statusDescription: "Found",
Expand All @@ -42,6 +43,7 @@ Resources:
};
return response;
}
- DomainSuffix: !FindInMap [DomainSuffixMap, !Ref Env, 'DomainSuffix']
FunctionConfig:
Comment: Redirects to the communities.gov.uk domains
Runtime: cloudfront-js-2.0
Expand Down

0 comments on commit 1564262

Please sign in to comment.