npm i aws-cdk-spa
import { SinglePageApplication } from 'aws-cdk-spa'
new SinglePageApplication(this, 'spa', {
applicationName: 'your-website-name',
websiteDirectory: 'public'
});
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. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { SinglePageApplication } from 'aws-cdk-spa'
SinglePageApplication.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
import { SinglePageApplicationProps } from 'aws-cdk-spa'
const singlePageApplicationProps: SinglePageApplicationProps = { ... }
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. |
public readonly applicationName: string;
- Type: string
Chosen name for single-page application.
public readonly websiteDirectory: string;
- Type: string
Path to folder containing contents of single-page application.
public readonly alternativeDomainNames: string[];
- Type: string[]
- Default: No alternative names on certificate.
Alternative domain names on your certificate.
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.
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").
public readonly websiteIndexDocument: string;
- Type: string
- Default: 'index.html'
The name of the index document (e.g. "index.html") for the website.