jetbridge / jetbridge/cdk-nextjs

Adding basic auth edge function

Open
#242 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
362
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Hi there,

I have difficulties adding basic auth edge function for my NextJS app.
I have tried the following but it doesn't seem to work:

```ts
const nextjs = new Nextjs(this, "MyApp", {
nextjsPath: path.join(__dirname, "../../apps/frontend"),
skipBuild: true,
overrides: {
nextjsDistribution: {
edgeFunctionProps: {
runtime: lambda.Runtime.NODEJS_22_X,
code: lambda.Code.fromAsset(path.join(__dirname, "../handlers"), {
bundling: {
command: ["bash", "-c", "cp -r * /asset-output/"],
image: cdk.DockerImage.fromRegistry(
"public.ecr.aws/docker/library/node:22-slim"
),
user: "root",
},
}),
handler: "basic_auth.handler",
memorySize: 128,
timeout: cdk.Duration.seconds(3),
},
},
},
});
```

Can you point me to what I am doing wrong?

Thanks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.