0.0.2 • Published 12 months ago

aws-cdk-spa v0.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
12 months ago

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)
NameTypeDescription
scopeconstructs.ConstructNo description.
idstringNo description.
propsSinglePageApplicationPropsNo description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired
  • Type: SinglePageApplicationProps

Methods

NameDescription
toStringReturns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

NameDescription
isConstructChecks 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

NameTypeDescription
nodeconstructs.NodeThe 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

NameTypeDescription
applicationNamestringChosen name for single-page application.
websiteDirectorystringPath to folder containing contents of single-page application.
alternativeDomainNamesstring[]Alternative domain names on your certificate.
domainNamestringDomain name for website.
websiteErrorDocumentstringThe 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").
websiteIndexDocumentstringThe 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.


0.0.2

12 months ago

0.0.1

12 months ago

0.0.0

12 months ago

0.1.0

3 years ago