aws-cdk-spa
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Single Page Application Construct for AWS-CDK

Installation

npm i aws-cdk-spa

Import into CDK app

import { SinglePageApplication } from 'aws-cdk-spa'

new SinglePageApplication(this, 'spa', {
    applicationName: 'your-website-name',
    websiteDirectory: 'public'
});

API Reference

Constructs

SinglePageApplication

Initializers

import { SinglePageApplication } from 'aws-cdk-spa'

new SinglePageApplication(scope: Construct, id: string, props: SinglePageApplicationProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props SinglePageApplicationProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { SinglePageApplication } from 'aws-cdk-spa'

SinglePageApplication.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


Structs

SinglePageApplicationProps

Initializer

import { SinglePageApplicationProps } from 'aws-cdk-spa'

const singlePageApplicationProps: SinglePageApplicationProps = { ... }

Properties

Name Type Description
applicationName string Chosen name for single-page application.
websiteDirectory string Path to folder containing contents of single-page application.
alternativeDomainNames string[] Alternative domain names on your certificate.
domainName string Domain name for website.
websiteErrorDocument string The name of the error document (e.g. "404.html") for the website. If the error document is not in the root folder, include the folder name followed by a slash and the error document name. (e.g. "errors/404.html").
websiteIndexDocument string The name of the index document (e.g. "index.html") for the website.

applicationNameRequired
public readonly applicationName: string;
  • Type: string

Chosen name for single-page application.


websiteDirectoryRequired
public readonly websiteDirectory: string;
  • Type: string

Path to folder containing contents of single-page application.


alternativeDomainNamesOptional
public readonly alternativeDomainNames: string[];
  • Type: string[]
  • Default: No alternative names on certificate.

Alternative domain names on your certificate.


domainNameOptional
public readonly domainName: string;
  • Type: string
  • Default: A website will be created with the default generated name (e.g., d111111abcdef8.cloudfront.net)

Domain name for website.


websiteErrorDocumentOptional
public readonly websiteErrorDocument: string;
  • Type: string
  • Default: '404.html'

The name of the error document (e.g. "404.html") for the website. If the error document is not in the root folder, include the folder name followed by a slash and the error document name. (e.g. "errors/404.html").


websiteIndexDocumentOptional
public readonly websiteIndexDocument: string;
  • Type: string
  • Default: 'index.html'

The name of the index document (e.g. "index.html") for the website.


Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.2
0latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.2
0
0.0.1
0
0.0.0
0

Package Sidebar

Install

npm i aws-cdk-spa

Weekly Downloads

0

Version

0.0.2

License

Apache-2.0

Unpacked Size

203 kB

Total Files

23

Last publish

Collaborators

  • vgpontes