Skip to content

Latest commit

 

History

History
179 lines (98 loc) · 5 KB

API.md

File metadata and controls

179 lines (98 loc) · 5 KB

API Reference

Constructs

ServerlessNextjs

Deploy Next.js as Lambda@Edge.

https://github.com/serverless-nextjs/serverless-next.js#architecture

Initializers

import { ServerlessNextjs } from '@rayova/cdk-serverless-nextjs'

new ServerlessNextjs(scope: Construct, id: string, props: ServerlessNextjsProps)
scopeRequired

idRequired
  • Type: string

propsRequired

Properties

cloudFrontConfigRequired
public readonly cloudFrontConfig: ServerlessNextjsCloudFrontConfig;

Structs

NextjsArtifactFromBuildOptions

Initializer

import { NextjsArtifactFromBuildOptions } from '@rayova/cdk-serverless-nextjs'

const nextjsArtifactFromBuildOptions: NextjsArtifactFromBuildOptions = { ... }
buildCommandRequired
public readonly buildCommand: string[];
  • Type: string[]

The command to build nextjs's .next directory.

i.e., ['yarn', 'build'] or ['yarn', 'next', 'build']


nextjsDirectoryRequired
public readonly nextjsDirectory: string;
  • Type: string

The directory containing the Next.js project.


ServerlessNextjsCloudFrontConfig

CloudFront configuration.

Initializer

import { ServerlessNextjsCloudFrontConfig } from '@rayova/cdk-serverless-nextjs'

const serverlessNextjsCloudFrontConfig: ServerlessNextjsCloudFrontConfig = { ... }
additionalBehaviorsRequired
public readonly additionalBehaviors: {[ key: string ]: BehaviorOptions};

Additional behaviors.


defaultBehaviorRequired
public readonly defaultBehavior: BehaviorOptions;

CDN default behavior.


ServerlessNextjsProps

Initializer

import { ServerlessNextjsProps } from '@rayova/cdk-serverless-nextjs'

const serverlessNextjsProps: ServerlessNextjsProps = { ... }
nextjsArtifactRequired
public readonly nextjsArtifact: NextjsArtifact;

The Next.js artifact.


Classes

NextjsArtifact

Initializers

import { NextjsArtifact } from '@rayova/cdk-serverless-nextjs'

new NextjsArtifact()

Static Functions

fromBuild
import { NextjsArtifact } from '@rayova/cdk-serverless-nextjs'

NextjsArtifact.fromBuild(options: NextjsArtifactFromBuildOptions)
optionsRequired