Skip to content

Commit

Permalink
create serverless PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantsinghaapc committed Jun 3, 2024
1 parent 869b6a8 commit 62f1eab
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions packages/serverless-components/nextjs-component/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,46 @@ class NextjsComponent extends Component {
}
};

cloudFrontOrigins[1].pathPatterns[
this.pathPattern("/shop/*", routesManifest)
] = {
minTTL: 0,
defaultTTL: 0,
maxTTL: 86400,
forward: {
cookies: "all",
headers: routesManifest.i18n
? ["Accept-Language", "Authorization", "Host"]
: ["Authorization", "Host"],
queryString: true
},
// lambda@edge key is last and therefore cannot be overridden
"lambda@edge": {
"origin-request": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`,
"origin-response": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`
}
};

cloudFrontOrigins[1].pathPatterns[
this.pathPattern("/shop", routesManifest)
] = {
minTTL: 0,
defaultTTL: 0,
maxTTL: 86400,
forward: {
cookies: "all",
headers: routesManifest.i18n
? ["Accept-Language", "Authorization", "Host"]
: ["Authorization", "Host"],
queryString: true
},
// lambda@edge key is last and therefore cannot be overridden
"lambda@edge": {
"origin-request": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`,
"origin-response": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`
}
};

// If we are using consolidated API pages (within default lambda), we need to ensure api/* behavior is set correctly.
// Note that if there are no consolidated API pages then existing api/* is not deleted.
// We do so for a couple reasons:
Expand Down

0 comments on commit 62f1eab

Please sign in to comment.