GreenVine / serverless-ts-boilerplate

Typescript Boilerplate for Serverless Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverless Typescript Boilerplate

Environment Variables

export API_DOMAIN=hello.api.example.com # API Gateway Endpoint Domain

export AWS_REGION=us-east-1 # Deployment Region

export API_CERT_NAME=*.api.example.com # API Certificate Name (Best match)

export API_STAGE=v1 # Stage name

Deployment

SSL Certificate

The environment variable API_CERT_NAME specifies the certificate name for API Gateway custom domain. The Serverless plugin will do the best-match over this name. Refer to serverless-domain-manager plugin documentation for detailed guidance.

Custom Domain

Set up

To set up the custom domain for API Gateway, simply run yarn run sls create_domain once.

Please note that this command cannot modify the existing custom domain that created previously by other means, e.g. through AWS Console, API.

Sample Output: Serverless: 'hello.api.example.com' was created/updated. New domains may take up to 40 minutes to be initialized.

Tear Down

To remove the custom domain, run yarn run sls delete_domain once.

Deploy Project

To deploy or update the project, run yarn run sls deploy.

Destroy Project

⚠️ To destroy all resources, run yarn run sls remove. Be careful when running this command towards a production stage name.

References

AWS as the Provider

About

Typescript Boilerplate for Serverless Framework


Languages

Language:JavaScript 63.2%Language:TypeScript 36.8%