https://github.com/serverless/serverless-client-s3
A plugin to deploy front-end assets to S3 via the Serverless Framework
https://github.com/serverless/serverless-client-s3
Last synced: 11 months ago
JSON representation
A plugin to deploy front-end assets to S3 via the Serverless Framework
- Host: GitHub
- URL: https://github.com/serverless/serverless-client-s3
- Owner: serverless
- Created: 2016-02-17T04:38:19.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-09-05T12:49:19.000Z (over 8 years ago)
- Last Synced: 2024-04-25T11:02:43.955Z (almost 2 years ago)
- Language: JavaScript
- Homepage: http://www.serverless.com
- Size: 35.2 KB
- Stars: 171
- Watchers: 40
- Forks: 65
- Open Issues: 38
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**DEPRECATION NOTICE: The NPM package of this project is not compatiable with v1.0+ of the Serverless Framework. Please use [serverless-finch](https://github.com/fernando-mc/serverless-finch) for an updated fork of this project.**
serverless-client-s3
====================
[](http://www.serverless.com)
[](https://gitter.im/serverless/serverless)
[](https://www.npmjs.com/package/serverless-client-s3)
[](https://www.npmjs.com/package/serverless-client-s3)
[](https://www.npmjs.com/package/serverless-client-s3)
[](https://www.npmjs.com/package/serverless-client-s3)
A Serverless plugin that deploys a web client for your Serverless project to an S3 bucket, and make it publicaly available in seconds.
**First**, install:
```
npm install --save serverless-client-s3
```
**Second**, update `serverless.yml` by adding the following:
```yaml
plugins:
- serverless-client-s3
custom:
client:
bucketName: serverless-client-bucketname
```
* **Warning:** The plugin will overwrite any data you have in the bucket name you set above if it already exists.
**Third**, Create a `client/dist` folder in the root directory of your Serverless project. This is where your distribution-ready website should live. It is recommended to have a `client/src` where you'll be developing your website, and a build script that outputs to `client/dist`. The plugin simply expects and uploads the entire `client/dist` folder to S3, configure the bucket to host the website, and make it publicly available.
Or just copy/run the following commands in the root directory of your Serverless project to get a quick sample website for deployment:
```
mkdir -p client/dist
touch client/dist/index.html
touch client/dist/error.html
echo "Go Serverless" >> client/dist/index.html
echo "error page" >> client/dist/error.html
```
**Fourth**, run the plugin, and visit your new website!
```
serverless client deploy [--stage $STAGE] [--region $REGION]
```
**Fifth**, Have fun!