Skip to content

Commit

Permalink
feat: allow to set custom handler (#2409)
Browse files Browse the repository at this point in the history
  • Loading branch information
Negan1911 committed Apr 20, 2022
1 parent e7af519 commit f5c33ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -151,7 +151,7 @@ export class NextJSLambdaEdge extends Construct {
this.defaultNextLambda = new lambda.Function(this, "NextLambda", {
functionName: toLambdaOption("defaultLambda", props.name),
description: `Default Lambda@Edge for Next CloudFront distribution`,
handler: "index.handler",
handler: props.handler || "index.handler",
currentVersionOptions: {
removalPolicy: RemovalPolicy.DESTROY // destroy old versions
},
Expand Down
Expand Up @@ -63,6 +63,11 @@ export interface Props extends StackProps {
imageCache?: string;
lambdaCache?: string;
};
/**
* If you use a custom handler with `.build()`, you can set the handler here.
*/
handler?: string;

/**
* Enable logging on the cloudfront distribution
*/
Expand Down

0 comments on commit f5c33ac

Please sign in to comment.