0.12.0 • Published 3 years ago

@serverlessui/cli v0.12.0

Weekly downloads
82
License
MIT
Repository
github
Last release
3 years ago

📖 CLI Reference

  1. deploy
  2. configure-domain

deploy

sui deploy

Options

OptionDescriptionDefault
--dirThe directory of your website's static files"dist"
--functionsThe directory of the functions to deploy as endpoints"functions"
--prodCustom Domains only: false will deploy a previewfalse

Note: The --dir directory should be only static files. You may need to run a build step prior to deploying

Examples

  • Deploy a preview of static website in a build directory with no functions
sui deploy --dir="build"
...
❯ Website Url: https://xxxxx.cloudfront.net
  • Deploy a preview of static website with serverless functions
sui deploy --dir="build" --functions="lambdas"
...
❯ Website Url: https://xxxxx.cloudfront.net
❯ API Url: https://xxxxx.cloudfront.net/api/my-function-name
❯ API Url: https://xxxxx.cloudfront.net/api/my-other-function-name
  • Production deploy

    Note: A custom domain must be configured for production deploys. See configure-domain

sui deploy --prod --dir="build" --functions="lambdas"
...
❯ Website Url: https://www.my-domain.com
❯ API Url: https://www.my-domain.com/api/my-function-name
❯ API Url: https://www.my-domain.com/api/my-other-function-name

configure-domain

This step only needs to be completed once, but it may take anywhere from 20 minutes - 48 hours to fully propogate

sui configure-domain [--domain]

Options

OptionDescriptionDefault
--domainYour custom domainNone

Additional Steps

A minute or two after running this command, the deploy will "hang" while trying to validate the domain prior to creating the wildcard certificate.

  1. Navigate to Route53

    Find your Hosted Zone and take note of the Zone Id and Name Servers

  2. Update the Nameservers on your Domain Registrar's website (eg. Namecheap)

  3. Wait

    The DNS resolution can be as quick as 10 minutes or take up to 48 hours. After some time, the Serverless UI command may timeout, but running it again should pick up where it left off.

  4. Navigate to Certificate Manager

    After the configure-domain command has completed successfully, navigate to Certificate Manager and take note of the Certificate Arn (eg. "arn:aws:acm:us-east-1:ACCOUNT_ID:certificate/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx")

  5. Create a Serverless UI config file

    Place the config file in the root of your project

    serverlessui.config.js

    module.exports = {
      domain: 'serverlessui.app',
      zoneId: 'Z10011111YYYYGGGRRR',
      certificateArn:
        'arn:aws:acm:us-east-1:ACCOUNT_ID:certificate/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx'
    }

License

Licensed under the MIT License.

0.11.0

3 years ago

0.12.0

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.0-alpha.0

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.1-alpha.0

3 years ago

0.6.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.5.0-alpha.0

3 years ago

0.4.0

3 years ago

0.3.1-alpha.2

3 years ago

0.3.1-alpha.1

3 years ago

0.3.1-alpha.0

3 years ago

0.3.0

3 years ago

0.2.1-alpha.1

3 years ago

0.2.1-alpha.0

3 years ago

0.2.0

3 years ago

0.2.0-alpha.8

3 years ago

0.2.0-alpha.7

3 years ago

0.2.0-alpha.6

3 years ago

0.2.0-alpha.5

3 years ago

0.2.0-alpha.4

3 years ago

0.2.0-alpha.3

3 years ago

0.2.0-alpha.2

3 years ago

0.2.0-alpha.1

3 years ago