0.1.42 • Published 3 years ago

@rayova/cdk-serverless-nextjs v0.1.42

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

Rayova A Fintech Corporation

CDK Serverless Next.js

This project provides an AWS CDK construct to Deploy Serverless Next.js to Lambda@Edge. We designed the construct following these principles:

  • Sensible defaults
  • Feature parity with Next.js
  • Fast deployments
  • Build the AWS Lambda deployment package for you
  • Provide BehaviorOptions for you to add to your CloudFront Distribution

Supported Next.js features

This construct library aims for feature parity with Next.js. Through @sls-next/lambda-at-edge, this CDK construct supports:

  • Next.js 10/11
  • Static pages
  • Server-side props
  • Static props and static prop fallback
  • Incremental static regeneration
  • Image optimization
  • API routes

Example Usage

// Create a ServerlessNextjs construct in your stack to get started.
// Your stack MUST be in us-east-1 as that's the only region in which AWS
// supports deploying edge lambdas.
const serverlessNextjs = new ServerlessNextjs(scope, 'NextJs', {
  // Then produce and add a Next.js artifact to ServerlessNextjs by
  // building it from your project directory.
  nextjsArtifact: NextjsArtifact.fromBuild({
    // Provide your Next.js project directory.
    nextjsDirectory: pathToYourProjectDirectory,

    // Provide the commands you need NextjsArtifact to run to build the
    // `.next` directory.
    buildCommand: ['yarn', 'next', 'build'],
  }),
});

// Create CloudFront distribution
const dist = new cloudfront.Distribution(scope, 'Distribution', {
  // And configure it with serverless Next.js as Lambda @ Edge
  ...serverlessNextjs.cloudFrontConfig,

  // Add anything else you need on your CloudFront distribution here, like
  // certificates, cnames, price classes, logging, etc.
});
0.1.41

3 years ago

0.1.42

3 years ago

0.1.40

3 years ago

0.1.38

3 years ago

0.1.39

3 years ago

0.1.31

3 years ago

0.1.32

3 years ago

0.1.33

3 years ago

0.1.34

3 years ago

0.1.35

3 years ago

0.1.36

3 years ago

0.1.37

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.30

3 years ago

0.0.61

3 years ago

0.1.27

3 years ago

0.1.28

3 years ago

0.1.29

3 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.24

3 years ago

0.1.25

3 years ago

0.1.26

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.0.40

3 years ago

0.0.41

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.44

3 years ago

0.0.45

3 years ago

0.0.46

3 years ago

0.0.47

3 years ago

0.0.37

3 years ago

0.0.38

3 years ago

0.0.39

3 years ago

0.0.36

3 years ago

0.0.60

3 years ago

0.0.59

3 years ago

0.0.51

3 years ago

0.0.52

3 years ago

0.0.53

3 years ago

0.0.54

3 years ago

0.0.55

3 years ago

0.0.56

3 years ago

0.0.57

3 years ago

0.0.58

3 years ago

0.0.50

3 years ago

0.0.48

3 years ago

0.0.49

3 years ago

0.0.35

3 years ago

0.0.32

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.13

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago