Skip to content
This repository has been archived by the owner on Feb 1, 2025. It is now read-only.

Commit

Permalink
docs: updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
true committed Sep 13, 2022
1 parent 1bc4310 commit e058d25
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,41 +65,24 @@ Lambda is designed to serve `_next/image*` route in NextJS stack and replaces th

### Via CDK

See `NextStandaloneStack` construct in `lib/construct.ts`.
See `NextStandaloneStack` construct in `cdk/example.ts`.

You can easily create `cdk/app.ts` and use following code:
```
#!/usr/bin/env node
import 'source-map-support/register'
import * as cdk from 'aws-cdk-lib'
import * as path from 'path'
import { NextStandaloneStack } from '@sladg/nextjs-lambda'
const assetsZipPath = path.resolve(__dirname, '../next.out/assetsLayer.zip')
const codeZipPath = path.resolve(__dirname, '../next.out/code.zip')
const dependenciesZipPath = path.resolve(__dirname, '../next.out/dependenciesLayer.zip')
const app = new cdk.App()

new NextStandaloneStack(app, 'StandaloneNextjsStack-2', {
assetsZipPath,
codeZipPath,
dependenciesZipPath,
})
```
#### Benchmark

This imports pre-made construct, you only need to worry about paths to outputed zip files from CLI `pack` command.
- Creation of stack: 385sec (6min 25sec)
- Run #2 436sec (7min 16sec)
- Run #3 383sec (6min 23sec)

> More granular CDK construct coming soon.

#### Benchmark
- Deletion of stack: 262sec (4min 22sec)
- Run #2 319sec (5m 19sec)

Creation of stack: 385sec (6min 25sec)
Run #2 436sec (7min 16sec)
Deletion of stack: 262sec (4min 22sec)
Update of stack:

- Update of stack: 92sec (1min 32sec)
- Run #2 5sec (no changes)
- Run #3 3sec (no changes)
- Run #4 164sec (2min 44sec)

### Sharp layer

Expand Down

0 comments on commit e058d25

Please sign in to comment.