4.0.0 • Published 5 years ago

@serverless/website v4.0.0

Weekly downloads
378
License
Apache
Repository
-
Last release
5 years ago

website

 

Deploy a static website to AWS S3 in seconds using Serverless Components.

 

  1. Install
  2. Create
  3. Configure
  4. Deploy

 

1. Install

$ npm install -g serverless

2. Create

$ mkdir my-website
$ cd my-website

the directory should look something like this:

|- code
  |- index.html
|- serverless.yml
|- .env      # your AWS api keys
# .env
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX

The code directory could either be a simple directory of html/css/js assets files, or a full fledged React app.

3. Configure

# serverless.yml

name: my-website
stage: dev

myWebsite:
  component: "@serverless/website"
  inputs:
    code:
      root: ./ # The root folder of your website project.  Defaults to current working directory
      src: ./src # The folder to be uploaded containing your built artifact
      hook: npm run build # A hook to build/test/do anything to your code before uploading
    region: us-east-1 # The AWS region to deploy your website into
    bucketName: myBucket # (Optional) The Bucket name where `src` files/folder will be upload. 
                         # If not provided, it will create random bucket name and upload `src` files
    env: # Environment variables to include in a 'env.js' file with your uploaded code.
      API_URL: https://api.com
      
    # You can specify a custom domain name for your website.
    # You must have a public hosted zone available for this domain in AWS Route53.
    # This is done automatically for you if you've purchased the domain via AWS Route53.
    domain: www.example.com 

4. Deploy

$ serverless

 

New to Components?

Checkout the Serverless Components repo for more information.

4.0.0

5 years ago

3.1.0

5 years ago

3.0.9

5 years ago

3.0.8

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago